secchan: Only let the controller connection set configuration flags.
authorBen Pfaff <blp@nicira.com>
Mon, 16 Mar 2009 17:05:52 +0000 (10:05 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 16 Mar 2009 17:07:34 +0000 (10:07 -0700)
Each OpenFlow connection to secchan, both controller connection and
management connections, is allowed to set its own miss_send_len and
send_flow_exp configuration, because these are really per-connection
state, not global state.  But management connection should not change
the global state (currently, just the treatment of fragments) when
they do this.

secchan/ofproto.c

index 2bd2633e10a2f366ce7619e6da6a9c75c63618a7..f3dce1912d0051838ae7179b7c7f076b373b8faf 100644 (file)
@@ -1399,17 +1399,19 @@ handle_set_config(struct ofproto *p, struct ofconn *ofconn,
 
     ofconn->send_flow_exp = (flags & OFPC_SEND_FLOW_EXP) != 0;
 
-    switch (flags & OFPC_FRAG_MASK) {
-    case OFPC_FRAG_NORMAL:
-        dpif_set_drop_frags(&p->dpif, false);
-        break;
-    case OFPC_FRAG_DROP:
-        dpif_set_drop_frags(&p->dpif, true);
-        break;
-    default:
-        VLOG_WARN_RL(&rl, "requested bad fragment mode (flags=%"PRIx16")",
-                     osc->flags);
-        break;
+    if (ofconn == p->controller) {
+        switch (flags & OFPC_FRAG_MASK) {
+        case OFPC_FRAG_NORMAL:
+            dpif_set_drop_frags(&p->dpif, false);
+            break;
+        case OFPC_FRAG_DROP:
+            dpif_set_drop_frags(&p->dpif, true);
+            break;
+        default:
+            VLOG_WARN_RL(&rl, "requested bad fragment mode (flags=%"PRIx16")",
+                         osc->flags);
+            break;
+        }
     }
 
     if ((ntohs(osc->miss_send_len) != 0) != (ofconn->miss_send_len != 0)) {