diff options
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/connmgr.c | 18 | ||||
-rw-r--r-- | ofproto/connmgr.h | 3 | ||||
-rw-r--r-- | ofproto/ofproto.c | 13 |
3 files changed, 23 insertions, 11 deletions
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 172a58cfb..b6af9ddb5 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -2193,7 +2193,8 @@ ofmonitor_report(struct connmgr *mgr, struct rule *rule, if (flags) { if (ovs_list_is_empty(&ofconn->updates)) { - ofputil_start_flow_update(&ofconn->updates); + ofputil_start_flow_update(&ofconn->updates, + ofconn_get_protocol(ofconn)); ofconn->sent_abbrev_update = false; } @@ -2243,6 +2244,7 @@ ofmonitor_flush(struct connmgr *mgr) OVS_REQUIRES(ofproto_mutex) { struct ofconn *ofconn; + enum ofputil_protocol protocol; if (!mgr) { return; @@ -2260,8 +2262,10 @@ ofmonitor_flush(struct connmgr *mgr) && rconn_packet_counter_n_bytes(counter) > 128 * 1024) { COVERAGE_INC(ofmonitor_pause); ofconn->monitor_paused = monitor_seqno++; + protocol = ofconn_get_protocol(ofconn); struct ofpbuf *pause = ofpraw_alloc_xid( - OFPRAW_NXT_FLOW_MONITOR_PAUSED, OFP10_VERSION, htonl(0), 0); + OFPRAW_NXT_FLOW_MONITOR_PAUSED, + ofputil_protocol_to_ofp_version(protocol), htonl(0), 0); ofconn_send(ofconn, pause, counter); } } @@ -2271,6 +2275,7 @@ static void ofmonitor_resume(struct ofconn *ofconn) OVS_REQUIRES(ofproto_mutex) { + enum ofputil_protocol protocol; struct rule_collection rules; rule_collection_init(&rules); @@ -2280,10 +2285,13 @@ ofmonitor_resume(struct ofconn *ofconn) } struct ovs_list msgs = OVS_LIST_INITIALIZER(&msgs); - ofmonitor_compose_refresh_updates(&rules, &msgs); + ofmonitor_compose_refresh_updates(&rules, &msgs, + ofconn_get_protocol(ofconn)); - struct ofpbuf *resumed = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_RESUMED, - OFP10_VERSION, htonl(0), 0); + protocol = ofconn_get_protocol(ofconn); + struct ofpbuf *resumed = ofpraw_alloc_xid( + OFPRAW_NXT_FLOW_MONITOR_RESUMED, + ofputil_protocol_to_ofp_version(protocol), htonl(0), 0); ovs_list_push_back(&msgs, &resumed->list_node); ofconn_send_replies(ofconn, &msgs); diff --git a/ofproto/connmgr.h b/ofproto/connmgr.h index e299386c7..56fdc3504 100644 --- a/ofproto/connmgr.h +++ b/ofproto/connmgr.h @@ -199,7 +199,8 @@ void ofmonitor_collect_resume_rules(struct ofmonitor *, uint64_t seqno, struct rule_collection *) OVS_REQUIRES(ofproto_mutex); void ofmonitor_compose_refresh_updates(struct rule_collection *rules, - struct ovs_list *msgs) + struct ovs_list *msgs, + enum ofputil_protocol protocol) OVS_REQUIRES(ofproto_mutex); void connmgr_send_table_status(struct connmgr *, diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 2ed107800..f59413c73 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -6421,7 +6421,8 @@ static void ofproto_compose_flow_refresh_update(const struct rule *rule, enum nx_flow_monitor_flags flags, struct ovs_list *msgs, - const struct tun_table *tun_table) + const struct tun_table *tun_table, + enum ofputil_protocol protocol) OVS_REQUIRES(ofproto_mutex) { const struct rule_actions *actions; @@ -6444,14 +6445,15 @@ ofproto_compose_flow_refresh_update(const struct rule *rule, fu.ofpacts_len = actions ? actions->ofpacts_len : 0; if (ovs_list_is_empty(msgs)) { - ofputil_start_flow_update(msgs); + ofputil_start_flow_update(msgs, protocol); } ofputil_append_flow_update(&fu, msgs, tun_table); } void ofmonitor_compose_refresh_updates(struct rule_collection *rules, - struct ovs_list *msgs) + struct ovs_list *msgs, + enum ofputil_protocol protocol) OVS_REQUIRES(ofproto_mutex) { struct rule *rule; @@ -6461,7 +6463,7 @@ ofmonitor_compose_refresh_updates(struct rule_collection *rules, rule->monitor_flags = 0; ofproto_compose_flow_refresh_update(rule, flags, msgs, - ofproto_get_tun_tab(rule->ofproto)); + ofproto_get_tun_tab(rule->ofproto), protocol); } } @@ -6625,7 +6627,8 @@ handle_flow_monitor_request(struct ofconn *ofconn, const struct ovs_list *msgs) struct ovs_list replies; ofpmp_init(&replies, ofpbuf_from_list(ovs_list_back(msgs))->header); - ofmonitor_compose_refresh_updates(&rules, &replies); + ofmonitor_compose_refresh_updates(&rules, &replies, + ofconn_get_protocol(ofconn)); ovs_mutex_unlock(&ofproto_mutex); rule_collection_destroy(&rules); |