X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=c94549faf4764729facd0c4b533728c38916655a;hb=8402c74b186e28c53ad51fc8813aebe64a12cd7c;hp=2dd3c9f71287d0380b41fd3dd48fe48c89acedc9;hpb=299016266ed13376a7d671f66d4e0181b41098e3;p=sliver-openvswitch.git diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 2dd3c9f71..c94549faf 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -324,6 +324,7 @@ ofproto_create(const char *datapath_name, const char *datapath_type, ofproto->datapath_id = 0; ofproto_set_flow_eviction_threshold(ofproto, OFPROTO_FLOW_EVICTON_THRESHOLD_DEFAULT); + ofproto->forward_bpdu = false; ofproto->fallback_dpid = pick_fallback_dpid(); ofproto->mfr_desc = xstrdup(DEFAULT_MFR_DESC); ofproto->hw_desc = xstrdup(DEFAULT_HW_DESC); @@ -429,6 +430,21 @@ ofproto_set_flow_eviction_threshold(struct ofproto *ofproto, unsigned threshold) } } +/* If forward_bpdu is true, the NORMAL action will forward frames with + * reserved (e.g. STP) destination Ethernet addresses. if forward_bpdu is false, + * the NORMAL action will drop these frames. */ +void +ofproto_set_forward_bpdu(struct ofproto *ofproto, bool forward_bpdu) +{ + bool old_val = ofproto->forward_bpdu; + ofproto->forward_bpdu = forward_bpdu; + if (old_val != ofproto->forward_bpdu) { + if (ofproto->ofproto_class->forward_bpdu_changed) { + ofproto->ofproto_class->forward_bpdu_changed(ofproto); + } + } +} + void ofproto_set_desc(struct ofproto *p, const char *mfr_desc, const char *hw_desc,