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:28:12 +0000 (08:28 -0800)
commitba4aaf6ae71ad674fc10a2b7ac69c444c2038afa
treeb05754207cb078eac63bf266bd395a14ead38cde
parent0190cc37082c33c7bb51b0fb88266b0be70a801a
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