odp-util: Always export the priority and skb_mark netlink attributes.
authorAndy Zhou <azhou@nicira.com>
Sat, 3 Aug 2013 19:23:15 +0000 (12:23 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 5 Aug 2013 20:48:16 +0000 (13:48 -0700)
commit830255c9a3f7e3dd41b92105e91e7eb05a612c5a
tree3299f6b5722b4649ed16884aafae93ef6c2c2c0d
parent5a9157f606bfcbe2f8079ea91af3e09756da3b09
odp-util: Always export the priority and skb_mark netlink attributes.

The current Netlink protocol allows a default value of zero if either mark
or priority is not specified (this is part of the ABI).  Until now, when
userspace serializes either the value or mask, it looked at the value and
omitted the netlink attribute if it is zero.  This is a bug because an
exact match on zero turns into a wildcard of the field.

These two fields (plus input port and EtherType) are special because they
can be omitted whereas most other values are required to be fully
specified.  These protocol variations tend to cause bugs (as above) when we
evolve the protocol because an exception that makes sense in one context
might not be logical in another.  Since the default value for mark and
priority are merely shorthands, we can push the protocol in a more
consistent direction by ignoring the shortcut and always serializing the
values.  This is what this commits does.

Signed-off-by: Andy Zhou <azhou@nicira.com>
[blp@nicira.com added Jesse's text to the commit message]
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/odp-util.c
tests/odp.at
tests/ofproto-dpif.at