zebra: zvni_map_to_svi may return NULL act accordingly

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>
This commit is contained in:
Donald Sharp 2019-10-28 20:52:40 -04:00
parent 7134ba7060
commit d1accb2e19

View File

@ -5775,12 +5775,14 @@ static void process_remote_macip_del(vni_t vni,
vlan_if = zvni_map_to_svi(vxl->access_vlan, vlan_if = zvni_map_to_svi(vxl->access_vlan,
zif->brslave_info.br_if); zif->brslave_info.br_if);
if (IS_ZEBRA_DEBUG_VXLAN) if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry", zlog_debug(
__PRETTY_FUNCTION__, "%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry",
ipaddr2str(ipaddr, buf1, __PRETTY_FUNCTION__,
sizeof(buf1)), n->flags, ipaddr2str(ipaddr, buf1, sizeof(buf1)),
vlan_if->name); n->flags,
neigh_read_specific_ip(ipaddr, vlan_if); 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 /* When the MAC changes for an IP, it is possible the