From e2ead27a7244d61e7f0f71f733f76118056f8981 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 15 Jun 2009 12:14:47 -0700 Subject: [PATCH] vswitch: Avoid segfault when revalidating ARP flows. The 'packet' argument to process_flow() is allowed to be null, but some of the code was assuming that it was always non-null, which caused a segfault while revalidating ARP flows. Bug #1394. --- vswitchd/bridge.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 10c6fee25..fc2939b97 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1758,10 +1758,17 @@ process_flow(struct bridge *br, const flow_t *flow, * an exception to this rule: the host has moved to another * switch. */ int src_idx = mac_learning_lookup(br->ml, flow->dl_src, vlan); - if (src_idx != -1 - && src_idx != in_port->port_idx - && !is_bcast_arp_reply(flow, packet)) { - goto done; + if (src_idx != -1 && src_idx != in_port->port_idx) { + if (packet) { + if (!is_bcast_arp_reply(flow, packet)) { + goto done; + } + } else { + /* No way to know whether it's an ARP reply, because the + * flow entry doesn't include enough information and we + * don't have a packet. Punt. */ + return false; + } } } } -- 2.43.0