[ovs-dev] [PATCH] ofproto: Fix possible core dump during flow revalidation.

Ethan Jackson ethan at nicira.com
Tue May 24 22:17:52 UTC 2011


This patch also prevents OVS from forwarding any LACP packets
whether or not LACP is enabled.  This is consistent with the
pre-next behavior.

Bug #5738.
---
 ofproto/ofproto-dpif.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index f44e164..d41c584 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1545,19 +1545,19 @@ process_special(struct ofproto_dpif *ofproto, const struct flow *flow,
 {
     if (cfm_should_process_flow(flow)) {
         struct ofport_dpif *ofport = get_ofp_port(ofproto, flow->in_port);
-        if (ofport && ofport->cfm) {
+        if (packet && ofport && ofport->cfm) {
             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 (port && port->bundle && port->bundle->lacp) {
+        if (packet && port && port->bundle && port->bundle->lacp) {
             const struct lacp_pdu *pdu = parse_lacp_packet(packet);
             if (pdu) {
                 lacp_process_pdu(port->bundle->lacp, port, pdu);
             }
-            return true;
         }
+        return true;
     }
     return false;
 }
-- 
1.7.4.4




More information about the dev mailing list