summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-23 01:19:18 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-02-23 01:23:27 +0100
commit8a3bc58ed891c693a032258b6c4dd9b3c01a6eb4 (patch)
tree8d125312e7a714428859342fc8ef952a08d66408 /zebra
parentMerge pull request #3851 from donaldsharp/bgp_routemap_fix (diff)
downloadfrr-8a3bc58ed891c693a032258b6c4dd9b3c01a6eb4.tar.xz
frr-8a3bc58ed891c693a032258b6c4dd9b3c01a6eb4.zip
zebra: Prevent crash in dad auto recovery
Commit: 6005fe55bce1c9cd54f4f7773fc2b0e15a99008f 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>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_vxlan.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 560cd89ab..333af473d 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -9162,16 +9162,16 @@ static int zebra_vxlan_dad_ip_auto_recovery_exp(struct thread *t)
nbr = THREAD_ARG(t);
/* since this is asynchronous we need sanity checks*/
- nbr = zvni_neigh_lookup(zvni, &nbr->ip);
- if (!nbr)
+ zvrf = vrf_info_lookup(nbr->zvni->vrf_id);
+ if (!zvrf)
return 0;
zvni = zvni_lookup(nbr->zvni->vni);
if (!zvni)
return 0;
- zvrf = vrf_info_lookup(zvni->vxlan_if->vrf_id);
- if (!zvrf)
+ nbr = zvni_neigh_lookup(zvni, &nbr->ip);
+ if (!nbr)
return 0;
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);
/* since this is asynchronous we need sanity checks*/
- mac = zvni_mac_lookup(zvni, &mac->macaddr);
- if (!mac)
+ zvrf = vrf_info_lookup(mac->zvni->vrf_id);
+ if (!zvrf)
return 0;
zvni = zvni_lookup(mac->zvni->vni);
if (!zvni)
return 0;
- zvrf = vrf_info_lookup(zvni->vxlan_if->vrf_id);
- if (!zvrf)
+ mac = zvni_mac_lookup(zvni, &mac->macaddr);
+ if (!mac)
return 0;
if (IS_ZEBRA_DEBUG_VXLAN)