Fix bug in clearing unsupported switch flags.
authorBen Pfaff <blp@nicira.com>
Thu, 7 Aug 2008 20:19:09 +0000 (13:19 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 7 Aug 2008 20:29:10 +0000 (13:29 -0700)
We need to keep the flags we support, not drop them.

datapath/forward.c
switch/datapath.c

index 318cfb3..524ee14 100644 (file)
@@ -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;
index 13d06ff..4d52dda 100644 (file)
@@ -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;