X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=ofproto%2Fofproto.c;h=8c10f19a14463002223beef9330f47850d208287;hb=4653c5583a3ec9d7184782fee3d2f93602795686;hp=522b791f48220226863996beec720bdc1a64ea5c;hpb=e2b9ac44c82590c2a9a27bff79ae43899277f703;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 522b791f..8c10f19a 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2298,14 +2298,15 @@ handle_port_desc_stats_request(struct ofconn *ofconn, const struct ofp_header *request) { struct ofproto *p = ofconn_get_ofproto(ofconn); + enum ofp_version version; struct ofport *port; struct list replies; ofpmp_init(&replies, request); + version = ofputil_protocol_to_ofp_version(ofconn_get_protocol(ofconn)); HMAP_FOR_EACH (port, hmap_node, &p->ports) { - ofputil_append_port_desc_stats_reply(ofconn_get_protocol(ofconn), - &port->pp, &replies); + ofputil_append_port_desc_stats_reply(version, &port->pp, &replies); } ofconn_send_replies(ofconn, &replies); @@ -3141,6 +3142,7 @@ ofproto_rule_send_removed(struct rule *rule, uint8_t reason) calc_flow_duration__(rule->created, time_msec(), &fr.duration_sec, &fr.duration_nsec); fr.idle_timeout = rule->idle_timeout; + fr.hard_timeout = rule->hard_timeout; rule->ofproto->ofproto_class->rule_get_stats(rule, &fr.packet_count, &fr.byte_count); @@ -3209,9 +3211,9 @@ handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh) goto exit_free_ofpacts; } + if (fm.flags & OFPFF10_EMERG) { /* We do not support the OpenFlow 1.0 emergency flow cache, which is not * required in OpenFlow 1.0.1 and removed from OpenFlow 1.1. */ - if (fm.flags & OFPFF_EMERG) { /* We do not support the emergency flow cache. It will hopefully get * dropped from OpenFlow in the near future. There is no good error * code, so just state that the flow table is full. */ @@ -3454,7 +3456,7 @@ ofproto_compose_flow_refresh_update(const struct rule *rule, fu.hard_timeout = rule->hard_timeout; fu.table_id = rule->table_id; fu.cookie = rule->flow_cookie; - fu.match = (struct cls_rule *) &rule->cr; + fu.match = CONST_CAST(struct cls_rule *, &rule->cr); if (!(flags & NXFMF_ACTIONS)) { fu.ofpacts = NULL; fu.ofpacts_len = 0;