ofproto-dpif: Never wildcard dl_type for "normal" action.
authorJustin Pettit <jpettit@nicira.com>
Wed, 12 Jun 2013 00:15:31 +0000 (17:15 -0700)
committerJustin Pettit <jpettit@nicira.com>
Wed, 12 Jun 2013 00:37:03 +0000 (17:37 -0700)
The is_gratuitous_arp() function is occasionally called when
processing the "normal" action.  The previous code only disabled
wildcarding the dl_type field when the function was called, but
since it runs occasionally, it could lead to inconsistencies in the
facet table.  This commit causes the dl_type to never be wildcarded
when the "normal" action is used.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif.c

index 8ac64b2..a355e46 100644 (file)
@@ -7567,7 +7567,6 @@ update_mirror_stats(struct ofproto_dpif *ofproto, mirror_mask_t mirrors,
 static bool
 is_gratuitous_arp(const struct flow *flow, struct flow_wildcards *wc)
 {
-    memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type);
     if (flow->dl_type != htons(ETH_TYPE_ARP)) {
         return false;
     }
@@ -7743,6 +7742,10 @@ xlate_normal(struct xlate_ctx *ctx)
 
     ctx->xout->has_normal = true;
 
+    /* Check the dl_type, since we may check for gratuituous ARP. */
+    memset(&ctx->xout->wc.masks.dl_type, 0xff,
+           sizeof ctx->xout->wc.masks.dl_type);
+
     memset(&ctx->xout->wc.masks.dl_src, 0xff,
            sizeof ctx->xout->wc.masks.dl_src);
     memset(&ctx->xout->wc.masks.dl_dst, 0xff,