From: Ben Pfaff Date: Fri, 26 Mar 2010 21:22:08 +0000 (-0700) Subject: ofproto: Drop "now" argument from send_flow_removed(). X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f275604bbee23976599c21e78130bba307f5d2a6;p=sliver-openvswitch.git ofproto: Drop "now" argument from send_flow_removed(). There's no reason that send_flow_removed() itself can't get the current time, and that means one less parameter for the caller. --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 9efc96eb7..6ef8b3b2d 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -160,7 +160,7 @@ static void rule_install(struct ofproto *, struct rule *, static void rule_uninstall(struct ofproto *, struct rule *); static void rule_post_uninstall(struct ofproto *, struct rule *); static void send_flow_removed(struct ofproto *p, struct rule *rule, - long long int now, uint8_t reason); + uint8_t reason); struct ofconn { struct list node; @@ -2923,8 +2923,7 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm, } if (command == OFPFC_DELETE) { - long long int now = time_msec(); - send_flow_removed(p, rule, now, OFPRR_DELETE); + send_flow_removed(p, rule, OFPRR_DELETE); rule_remove(p, rule); } else { size_t actions_len = n_actions * sizeof *rule->actions; @@ -3366,9 +3365,9 @@ uninstall_idle_flow(struct ofproto *ofproto, struct rule *rule) } } static void -send_flow_removed(struct ofproto *p, struct rule *rule, - long long int now, uint8_t reason) +send_flow_removed(struct ofproto *p, struct rule *rule, uint8_t reason) { + long long int now = time_msec(); struct ofconn *ofconn; struct ofconn *prev; struct ofpbuf *buf = NULL; @@ -3437,7 +3436,7 @@ expire_rule(struct cls_rule *cls_rule, void *p_) } if (!rule_is_hidden(rule)) { - send_flow_removed(p, rule, now, + send_flow_removed(p, rule, (now >= hard_expire ? OFPRR_HARD_TIMEOUT : OFPRR_IDLE_TIMEOUT)); }