From: Ben Pfaff Date: Thu, 7 Aug 2008 20:19:09 +0000 (-0700) Subject: Fix bug in clearing unsupported switch flags. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7462f2e8bd3ed2170d6a5da5295b176a1914de6a;p=openvswitch Fix bug in clearing unsupported switch flags. We need to keep the flags we support, not drop them. --- diff --git a/datapath/forward.c b/datapath/forward.c index 318cfb3c..524ee14f 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -308,7 +308,7 @@ recv_set_config(struct sw_chain *chain, const struct sender *sender, const struct ofp_switch_config *osc = msg; int flags; - flags = ntohs(osc->flags) & ~(OFPC_SEND_FLOW_EXP | OFPC_FRAG_MASK); + flags = ntohs(osc->flags) & (OFPC_SEND_FLOW_EXP | OFPC_FRAG_MASK); if ((flags & OFPC_FRAG_MASK) != OFPC_FRAG_NORMAL && (flags & OFPC_FRAG_MASK) != OFPC_FRAG_DROP) { flags = (flags & ~OFPC_FRAG_MASK) | OFPC_FRAG_DROP; diff --git a/switch/datapath.c b/switch/datapath.c index 13d06ff1..4d52dda9 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -985,7 +985,7 @@ recv_set_config(struct datapath *dp, const struct sender *sender UNUSED, const struct ofp_switch_config *osc = msg; int flags; - flags = ntohs(osc->flags) & ~(OFPC_SEND_FLOW_EXP | OFPC_FRAG_MASK); + flags = ntohs(osc->flags) & (OFPC_SEND_FLOW_EXP | OFPC_FRAG_MASK); if ((flags & OFPC_FRAG_MASK) != OFPC_FRAG_NORMAL && (flags & OFPC_FRAG_MASK) != OFPC_FRAG_DROP) { flags = (flags & ~OFPC_FRAG_MASK) | OFPC_FRAG_DROP;