X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fconnmgr.c;h=05e69c7f9df90d4df02462f60a678143861aac22;hb=3dd3eace3f21c53ac59e717624eae12d37554895;hp=5ce77c04c579e97e129c77f4ce3a368cce513f9d;hpb=982697a4d24caa0a3bdaf85db67619338b382e50;p=openvswitch diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 5ce77c04..05e69c7f 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -477,7 +477,7 @@ connmgr_free_controller_info(struct shash *info) SHASH_FOR_EACH (node, info) { struct ofproto_controller_info *cinfo = node->data; while (cinfo->pairs.n) { - free((char *) cinfo->pairs.values[--cinfo->pairs.n]); + free(CONST_CAST(char *, cinfo->pairs.values[--cinfo->pairs.n])); } free(cinfo); } @@ -1407,7 +1407,8 @@ schedule_packet_in(struct ofconn *ofconn, struct ofputil_packet_in pin) * while (until a later call to pinsched_run()). */ pinsched_send(ofconn->schedulers[pin.reason == OFPR_NO_MATCH ? 0 : 1], pin.fmd.in_port, - ofputil_encode_packet_in(&pin, ofconn->packet_in_format), + ofputil_encode_packet_in(&pin, ofconn->protocol, + ofconn->packet_in_format), do_send_packet_in, ofconn); } @@ -1599,14 +1600,14 @@ connmgr_flushed(struct connmgr *mgr) if (!connmgr_has_controllers(mgr) && mgr->fail_mode == OFPROTO_FAIL_STANDALONE) { struct ofpbuf ofpacts; - struct cls_rule rule; + struct match match; ofpbuf_init(&ofpacts, OFPACT_OUTPUT_SIZE); ofpact_put_OUTPUT(&ofpacts)->port = OFPP_NORMAL; ofpact_pad(&ofpacts); - cls_rule_init_catchall(&rule, 0); - ofproto_add_flow(mgr->ofproto, &rule, ofpacts.data, ofpacts.size); + match_init_catchall(&match); + ofproto_add_flow(mgr->ofproto, &match, 0, ofpacts.data, ofpacts.size); ofpbuf_uninit(&ofpacts); } @@ -1716,7 +1717,7 @@ ofmonitor_create(const struct ofputil_flow_monitor_request *request, m->flags = request->flags; m->out_port = request->out_port; m->table_id = request->table_id; - m->match = request->match; + minimatch_init(&m->match, &request->match); *monitorp = m; return 0; @@ -1804,6 +1805,7 @@ ofmonitor_report(struct connmgr *mgr, struct rule *rule, if (ofconn != abbrev_ofconn || ofconn->monitor_paused) { struct ofputil_flow_update fu; + struct match match; fu.event = event; fu.reason = event == NXFME_DELETED ? reason : 0; @@ -1811,7 +1813,9 @@ ofmonitor_report(struct connmgr *mgr, struct rule *rule, fu.hard_timeout = rule->hard_timeout; fu.table_id = rule->table_id; fu.cookie = rule->flow_cookie; - fu.match = &rule->cr; + minimatch_expand(&rule->cr.match, &match); + fu.match = &match; + fu.priority = rule->cr.priority; if (flags & NXFMF_ACTIONS) { fu.ofpacts = rule->ofpacts; fu.ofpacts_len = rule->ofpacts_len;