]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: zvni_map_to_svi may return NULL act accordingly
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 29 Oct 2019 00:52:40 +0000 (20:52 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 29 Oct 2019 00:52:40 +0000 (20:52 -0400)
The zvni_map_to_svi function may return NULL as such prevent
a deref and crash.  Found via coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_vxlan.c

index 2417b505adf9dd6aa5ae66f2009faaf6504fff1a..1d2748c8efc3d9a5c54ec89edf5f67c8e62dfcf6 100644 (file)
@@ -5775,12 +5775,14 @@ static void process_remote_macip_del(vni_t vni,
                        vlan_if = zvni_map_to_svi(vxl->access_vlan,
                                        zif->brslave_info.br_if);
                        if (IS_ZEBRA_DEBUG_VXLAN)
-                               zlog_debug("%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry",
-                                          __PRETTY_FUNCTION__,
-                                          ipaddr2str(ipaddr, buf1,
-                                                     sizeof(buf1)), n->flags,
-                                          vlan_if->name);
-                       neigh_read_specific_ip(ipaddr, vlan_if);
+                               zlog_debug(
+                                       "%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry",
+                                       __PRETTY_FUNCTION__,
+                                       ipaddr2str(ipaddr, buf1, sizeof(buf1)),
+                                       n->flags,
+                                       vlan_if ? vlan_if->name : "Unknown");
+                       if (vlan_if)
+                               neigh_read_specific_ip(ipaddr, vlan_if);
                }
 
                /* When the MAC changes for an IP, it is possible the