<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Maps and Dictionaries need catch-all ('default:' 'else') case for when no entry matches."
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1132">1132</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Maps and Dictionaries need catch-all ('default:' 'else') case for when no entry matches.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>nftables
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>kernel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pablo@netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rwhite@pobox.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It would be extremely helpful if the various look-up cases had the option of
including a default value or verdict to return or execute (respectively) when
no entry matches.

This doesn't really make sense for plain sets where membership is what's being
tested, but for the branch-like implicit in mapping it's 'very hard' to create
some kinds of 'else' branch.

So like...

table ip example {
    map server {
        type inet_service : ipv4_addr
        flags interval, default
        default = 172.18.0.2
        elements = { 9994 : 172.18.0.5}
    }
}

Default is, obviously just an the result data type with none of the key parts
so it's not really part of the elements = {} part.

using elements = { default: 17.18.0.2 } is too complicated since something
could be named "default" in whatever lookup NSS is in force (e.g. "echo default
4455/tcp >> /etc/services" would damage other syntax choices). So best to add
it as a keyword. I'd put it in the flags to make it explicit and so prevent
brain damage.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>