- Fix type for "get config" replies.
printk("datapath: problem setting up 'of' device\n");
#endif
- dp->config.flags = 0;
- dp->config.miss_send_len = htons(OFP_DEFAULT_MISS_SEND_LEN);
+ dp->flags = 0;
+ dp->miss_send_len = OFP_DEFAULT_MISS_SEND_LEN;
dp->dp_task = kthread_run(dp_maint_func, dp, "dp%d", dp_idx);
if (IS_ERR(dp->dp_task))
struct sk_buff *skb;
struct ofp_switch_config *osc;
- osc = alloc_openflow_skb(dp, sizeof *osc, OFPT_PORT_STATUS, sender,
+ osc = alloc_openflow_skb(dp, sizeof *osc, OFPT_GET_CONFIG_REPLY, sender,
&skb);
if (!osc)
return -ENOMEM;
- memcpy(((char *)osc) + sizeof osc->header,
- ((char *)&dp->config) + sizeof dp->config.header,
- sizeof dp->config - sizeof dp->config.header);
+
+ osc->flags = htons(dp->flags);
+ osc->miss_send_len = htons(dp->miss_send_len);
+
return send_openflow_skb(skb, sender);
}
struct net_device dev;
struct net_device_stats stats;
- struct ofp_switch_config config;
+ /* Configuration set from controller */
+ uint16_t flags;
+ uint16_t miss_send_len;
/* Switch ports. */
struct net_bridge_port *ports[OFPP_MAX];
flow->actions, flow->n_actions);
} else {
dp_output_control(chain->dp, skb, fwd_save_skb(skb),
- ntohs(chain->dp->config.miss_send_len),
+ chain->dp->miss_send_len,
OFPR_NO_MATCH);
}
}
const void *msg)
{
const struct ofp_switch_config *osc = msg;
- chain->dp->config = *osc;
+
+ chain->dp->flags = ntohs(osc->flags);
+ chain->dp->miss_send_len = ntohs(osc->miss_send_len);
+
return 0;
}
struct sw_flow *flow = *bucket;
if (flow && flow_timeout(flow)) {
count += do_delete(bucket, flow);
- if (dp->config.flags & OFPC_SEND_FLOW_EXP)
+ if (dp->flags & OFPC_SEND_FLOW_EXP)
dp_send_flow_expired(dp, flow);
}
}
struct sw_flow *flow = list_entry(pos, struct sw_flow, u.node);
if (flow_timeout(flow)) {
count += do_delete(swt, flow);
- if (dp->config.flags & OFPC_SEND_FLOW_EXP)
+ if (dp->flags & OFPC_SEND_FLOW_EXP)
dp_send_flow_expired(dp, flow);
}
}
/* Header on all OpenFlow packets. */
struct ofp_header {
- uint8_t version; /* Always 1. */
+ uint8_t version; /* OFP_VERSION. */
uint8_t type; /* One of the OFPT_ constants. */
uint16_t length; /* Length including this ofp_header. */
uint32_t xid; /* Transactin id associated with this packet.