From c432bff7928a41651b0a14f499ba8b27f0c0b6e8 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Tue, 11 Jun 2013 17:15:31 -0700 Subject: [PATCH] ofproto-dpif: Never wildcard dl_type for "normal" action. 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 Acked-by: Ethan Jackson --- ofproto/ofproto-dpif.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 46c426afd..74a6ead10 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -7484,7 +7484,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; } @@ -7660,6 +7659,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, -- 2.47.0