From 7a685cb31255f0f87cfa8fb75a1a1062ceceaa23 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 16 Mar 2009 10:05:52 -0700 Subject: [PATCH] secchan: Only let the controller connection set configuration flags. 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 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 2bd2633e..f3dce191 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -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)) { -- 2.30.2