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:33:50 +0000 (13:33 -0700)
commit54bb0348d2588aab6447784bb0ca8ff0b794df15
tree16fc1851647172ec2cda74797721b5db411fb22b
parent016953ae96bebb3d3c421757d1f98b9966433bd1
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