Fix issue with "strict" deletion of flows
authorJustin Pettit <jpettit@nicira.com>
Thu, 6 May 2010 21:05:25 +0000 (14:05 -0700)
committerJustin Pettit <jpettit@nicira.com>
Thu, 6 May 2010 21:44:00 +0000 (14:44 -0700)
OpenFlow provides the ability to delete flows that match a "strict"
description.  This means that wildcards are not active, and thus will
only match a single flow that exactly matches the description.  The code
that checks for a match is pretty dumb and still compares the values of
fields that are wildcarded.  A recent change added a "tun_id" matching
field, but did not zero out the field when it was supposed to be
ignored, which broke the matching used by strict deletions.  This sets
the field regardless of whether the field is wildcarded or not.

Reported-by: Natasha Gude <natasha@nicira.com>
Bug #2775

lib/flow.c

index 700e7f8..fb7cf32 100644 (file)
@@ -285,6 +285,8 @@ flow_from_match(const struct ofp_match *match, bool tun_id_from_cookie,
     flow->nw_dst = match->nw_dst;
     if (tun_id_from_cookie) {
         flow->tun_id = htonl(ntohll(cookie) >> 32);
+    } else {
+        flow->tun_id = 0;
     }
     flow->in_port = (match->in_port == htons(OFPP_LOCAL) ? ODPP_LOCAL
                      : ntohs(match->in_port));