[Bug 1132] New: Maps and Dictionaries need catch-all ('default:' 'else') case for when no entry matches.
bugzilla-daemon at netfilter.org
bugzilla-daemon at netfilter.org
Sat Mar 18 00:16:25 CET 2017
https://bugzilla.netfilter.org/show_bug.cgi?id=1132
Bug ID: 1132
Summary: Maps and Dictionaries need catch-all ('default:'
'else') case for when no entry matches.
Product: nftables
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5
Component: kernel
Assignee: pablo at netfilter.org
Reporter: rwhite at pobox.com
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.
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20170317/59ef09b4/attachment.html>
More information about the netfilter-buglog
mailing list