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 16:24:16 +0000 (08:24 -0800)
commitc56fac1b678101b189e16f0462556c992feeffdc
tree50ca805a015ad50caa3d015a9784efcac3ee2591
parent276e2864c517a13f9a3ba33086b091743096d30c
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