odp-util: Include tun_id when nonzero even if "key" flag not set.
authorBen Pfaff <blp@nicira.com>
Sun, 2 Mar 2014 01:11:02 +0000 (17:11 -0800)
committerBen Pfaff <blp@nicira.com>
Sun, 2 Mar 2014 01:39:24 +0000 (17:39 -0800)
commit37dfcd695e5e29e1d6051b0d53385fd7ae686bc5
treec962e0b034ab70be3b755fc2b18ee37415e3685b
parentfc27bdc6ce5b6b3f95dbbc1ef5adbf3aa0e58e4a
odp-util: Include tun_id when nonzero even if "key" flag not set.

When a flow_tnl is being translated to Netlink attributes, the tun_id field
was included only if the FLOW_TNL_F_KEY flag was set.  This meant that for
a mask, where one would not necessarily expect that flag to be set even if
there were a key, the tun_id could be omitted even if it were nonzero.
This led to kernel flows that did not match on a field that was required
to be matched (possibly causing incorrect treatment of packets) and
premature deletion of kernel flows due to mask mismatch.  This commit
fixes the problem.

Bug #1192516.
Reported-by: Krishna Miriyala <miriyalak@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
lib/odp-util.c