From: Ethan Jackson Date: Tue, 24 May 2011 22:12:13 +0000 (-0700) Subject: ofproto: Fix possible core dump during flow revalidation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da37ebac7ab40ad6f9fe78ff1d218c43957f69e8;p=openvswitch ofproto: Fix possible core dump during flow revalidation. 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. --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index f44e1642..d41c584e 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; }