mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 16:07:20 +00:00
zebra: Prevent crash in dad auto recovery
Commit: 6005fe55bc
Introduced a crash with zebra looking up either the
nbr structure or the mac structure. This is because
the zvni used is NULL and we eventually call a hash_lookup
call that would cause a NULL dereference. Partially
revert this commit to original behavior.
Problems found via clang Static Analyzer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
f4756ad737
commit
8a3bc58ed8
@ -9162,16 +9162,16 @@ static int zebra_vxlan_dad_ip_auto_recovery_exp(struct thread *t)
|
|||||||
nbr = THREAD_ARG(t);
|
nbr = THREAD_ARG(t);
|
||||||
|
|
||||||
/* since this is asynchronous we need sanity checks*/
|
/* since this is asynchronous we need sanity checks*/
|
||||||
nbr = zvni_neigh_lookup(zvni, &nbr->ip);
|
zvrf = vrf_info_lookup(nbr->zvni->vrf_id);
|
||||||
if (!nbr)
|
if (!zvrf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
zvni = zvni_lookup(nbr->zvni->vni);
|
zvni = zvni_lookup(nbr->zvni->vni);
|
||||||
if (!zvni)
|
if (!zvni)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
zvrf = vrf_info_lookup(zvni->vxlan_if->vrf_id);
|
nbr = zvni_neigh_lookup(zvni, &nbr->ip);
|
||||||
if (!zvrf)
|
if (!nbr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_VXLAN)
|
if (IS_ZEBRA_DEBUG_VXLAN)
|
||||||
@ -9212,16 +9212,16 @@ static int zebra_vxlan_dad_mac_auto_recovery_exp(struct thread *t)
|
|||||||
mac = THREAD_ARG(t);
|
mac = THREAD_ARG(t);
|
||||||
|
|
||||||
/* since this is asynchronous we need sanity checks*/
|
/* since this is asynchronous we need sanity checks*/
|
||||||
mac = zvni_mac_lookup(zvni, &mac->macaddr);
|
zvrf = vrf_info_lookup(mac->zvni->vrf_id);
|
||||||
if (!mac)
|
if (!zvrf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
zvni = zvni_lookup(mac->zvni->vni);
|
zvni = zvni_lookup(mac->zvni->vni);
|
||||||
if (!zvni)
|
if (!zvni)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
zvrf = vrf_info_lookup(zvni->vxlan_if->vrf_id);
|
mac = zvni_mac_lookup(zvni, &mac->macaddr);
|
||||||
if (!zvrf)
|
if (!mac)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_VXLAN)
|
if (IS_ZEBRA_DEBUG_VXLAN)
|
||||||
|
Loading…
Reference in New Issue
Block a user