From 27fbef21af982852659d33e25807bf092d73b970 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 27 Apr 2009 16:56:44 -0700 Subject: [PATCH] secchan: Remove unused parameter from ofproto_add_flow(). The 'packet != NULL' case was effectively dead, since every caller passed a constant NULL here, so delete the parameter and the code to handle the non-NULL case. --- secchan/fail-open.c | 2 +- secchan/in-band.c | 2 +- secchan/ofproto.c | 12 ++---------- secchan/ofproto.h | 2 +- vswitchd/bridge.c | 2 +- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/secchan/fail-open.c b/secchan/fail-open.c index 9a8a3d49..04d53689 100644 --- a/secchan/fail-open.c +++ b/secchan/fail-open.c @@ -109,7 +109,7 @@ fail_open_flushed(struct fail_open *fo) action.output.port = htons(OFPP_NORMAL); memset(&flow, 0, sizeof flow); ofproto_add_flow(fo->ofproto, &flow, OFPFW_ALL, 70000, - &action, 1, NULL, 0); + &action, 1, 0); } } diff --git a/secchan/in-band.c b/secchan/in-band.c index 2315c44b..aac39aaa 100644 --- a/secchan/in-band.c +++ b/secchan/in-band.c @@ -228,7 +228,7 @@ setup_flow(struct in_band *in_band, int rule_idx, const flow_t *flow, action.output.port = htons(out_port); action.output.max_len = htons(0); ofproto_add_flow(in_band->ofproto, &rule->flow, rule->wildcards, - rule->priority, &action, 1, NULL, 0); + rule->priority, &action, 1, 0); } } diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 50b126aa..b21acbb1 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -954,7 +954,7 @@ void ofproto_add_flow(struct ofproto *p, const flow_t *flow, uint32_t wildcards, unsigned int priority, const union ofp_action *actions, size_t n_actions, - const struct ofpbuf *packet, int idle_timeout) + int idle_timeout) { struct rule *rule, *displaced_rule; @@ -968,17 +968,9 @@ ofproto_add_flow(struct ofproto *p, } if (!wildcards) { - rule_make_actions(p, rule, packet); - if (packet - && !dpif_execute(&p->dpif, flow->in_port, - rule->odp_actions, rule->n_odp_actions, packet)) { - rule->byte_count = packet->size; - rule->packet_count++; - } + rule_make_actions(p, rule, NULL); rule_install(p, rule, NULL); } else { - assert(!packet); - /* We might need to change the rules for arbitrary subrules. */ p->need_revalidate = true; } diff --git a/secchan/ofproto.h b/secchan/ofproto.h index b0a54639..91c51c41 100644 --- a/secchan/ofproto.h +++ b/secchan/ofproto.h @@ -103,7 +103,7 @@ int ofproto_send_packet(struct ofproto *, const flow_t *, void ofproto_add_flow(struct ofproto *, const flow_t *, uint32_t wildcards, unsigned int priority, const union ofp_action *, size_t n_actions, - const struct ofpbuf *, int idle_timeout); + int idle_timeout); void ofproto_delete_flow(struct ofproto *, const flow_t *, uint32_t wildcards, unsigned int priority); void ofproto_flush_flows(struct ofproto *); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 69e1a581..e0706a85 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1089,7 +1089,7 @@ bridge_reconfigure_one(struct bridge *br) action.output.port = htons(OFPP_NORMAL); memset(&flow, 0, sizeof flow); ofproto_add_flow(br->ofproto, &flow, OFPFW_ALL, 0, - &action, 1, NULL, 0); + &action, 1, 0); ofproto_set_in_band(br->ofproto, false); ofproto_set_max_backoff(br->ofproto, 1); -- 2.30.2