ofproto-dpif-xlate: Make flows that match ICMP fields revalidate correctly.
authorBen Pfaff <blp@nicira.com>
Tue, 11 Feb 2014 16:24:16 +0000 (08:24 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 11 Feb 2014 17:43:26 +0000 (09:43 -0800)
commitd2bf1bf62e81862fe02795277b9427916f2d9425
treec514369147ab8141f1b382954c560f1ca8229f4c
parent89ffab9d002bb74c829a45c499386769749f741c
ofproto-dpif-xlate: Make flows that match ICMP fields revalidate correctly.

ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields.  struct flow
uses the low 8 bits of the 16-bit tp_src and tp_dst members to
represent these fields.  The datapath interface, on the other hand,
represents them with just 8 bits each.  This means that if the high 8
bits of the masks for these fields somehow become set (meaning to
match on the nonexistent "high bits" of these fields) during
translation, then they will get chopped off by a round trip through
the datapath, and revalidation will spot that as an inconsistency and
delete the flow.  This commit avoids the problem by making sure that
only the low 8 bits of either field can be unwildcarded for ICMP.

This seems like the minimal fix for this problem, appropriate for
backporting to earlier branches.  The root of the issue is that these high
bits can get set in the match at all.  I have some leads on that, but they
require more invasive changes elsewhere.

Bug #23320.
Reported-by: Krishna Miriyala <miriyalak@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/meta-flow.c
lib/packets.h
ofproto/ofproto-dpif-xlate.c