ofproto: Fix possible core dump during flow revalidation.
authorEthan Jackson <ethan@nicira.com>
Tue, 24 May 2011 22:12:13 +0000 (15:12 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 24 May 2011 22:17:03 +0000 (15:17 -0700)
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

index f44e1642f8d0eeab00041d2e2b43c65fb61864a4..d41c584ea660e8c2a3ddbae680934307e76bbe5b 100644 (file)
@@ -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;
 }