diff options
| author | Ethan Jackson <ethan@nicira.com> | 2011-08-30 18:19:48 -0700 |
|---|---|---|
| committer | Ethan Jackson <ethan@nicira.com> | 2011-09-08 17:23:26 -0700 |
| commit | b6e001b699d9affb558278ec90950f9960fe1826 (patch) | |
| tree | 7d374e7df37e187f8e46c9e1349e633b4c7a529a /ofproto | |
| parent | 5f87736966c0a2ef4d5d4a3c5c541d771d45bcb3 (diff) | |
| download | openvswitch-b6e001b699d9affb558278ec90950f9960fe1826.tar.gz | |
ofproto-dpif: Drop special packets more judiciously.
Before this patch, ofproto-dpif would not forward any LACP or CFM
packets regardless of whether or not the relevant modules were
configured on the in_port.
Feature #6316.
Diffstat (limited to 'ofproto')
| -rw-r--r-- | ofproto/ofproto-dpif.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 478768f00..c84456bc1 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1614,16 +1614,21 @@ static bool process_special(struct ofproto_dpif *ofproto, const struct flow *flow, const struct ofpbuf *packet) { - if (cfm_should_process_flow(flow)) { - struct ofport_dpif *ofport = get_ofp_port(ofproto, flow->in_port); - if (packet && ofport && ofport->cfm) { + struct ofport_dpif *ofport = get_ofp_port(ofproto, flow->in_port); + + if (!ofport) { + return false; + } + + if (ofport->cfm && cfm_should_process_flow(flow)) { + if (packet) { cfm_process_heartbeat(ofport->cfm, packet); } return true; - } else if (flow->dl_type == htons(ETH_TYPE_LACP)) { - struct ofport_dpif *port = get_ofp_port(ofproto, flow->in_port); - if (packet && port && port->bundle && port->bundle->lacp) { - lacp_process_packet(port->bundle->lacp, port, packet); + } else if (ofport->bundle && ofport->bundle->lacp + && flow->dl_type == htons(ETH_TYPE_LACP)) { + if (packet) { + lacp_process_packet(ofport->bundle->lacp, ofport, packet); } return true; } |
