X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=9efc96eb708a70ed9fb584c9cb91ee2edacdaab0;hb=e40a9944f7fc391bb503414d8aadf970c323980b;hp=a5edf9e1c9d9954998c2cef33162d286c0214596;hpb=01149cfd28851f963a4a16b87fb2cd76919db099;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index a5edf9e1..9efc96eb 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2597,7 +2597,7 @@ query_stats(struct ofproto *p, struct rule *rule, odp_flows[0].key = rule->cr.flow; } - /* Fetch up-to-date statistics from the datapath and add them in. */ */ + /* Fetch up-to-date statistics from the datapath and add them in. */ if (!dpif_flow_get_multiple(p->dpif, odp_flows, n_odp_flows)) { size_t i; for (i = 0; i < n_odp_flows; i++) { @@ -2929,6 +2929,7 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm, } else { size_t actions_len = n_actions * sizeof *rule->actions; + rule->flow_cookie = ofm->cookie; if (n_actions == rule->n_actions && !memcmp(ofm->actions, rule->actions, actions_len)) { @@ -2938,7 +2939,6 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm, free(rule->actions); rule->actions = xmemdup(ofm->actions, actions_len); rule->n_actions = n_actions; - rule->flow_cookie = ofm->cookie; if (rule->cr.wc.wildcards) { COVERAGE_INC(ofproto_mod_wc_flow); @@ -3335,7 +3335,7 @@ compose_flow_removed(const struct rule *rule, long long int now, uint8_t reason) { struct ofp_flow_removed *ofr; struct ofpbuf *buf; - long long int tdiff = time_msec() - rule->created; + long long int tdiff = now - rule->created; uint32_t sec = tdiff / 1000; uint32_t msec = tdiff - (sec * 1000);