summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-10-25 13:30:45 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-10-25 13:43:51 -0400
commit819f099bdda04e7e378f916eb0f8e3da669cd8ae (patch)
treef56b5f1f14bee98aeb694d0674b9912bd96b04b4 /pimd/pim_iface.c
parentef47f23b913e9ff6ba85c807ed36cfbe782c1d75 (diff)
pimd: Cleanup vrf SA issues exposed by recent commits
A recent commit has shown that we were not consistent with handling of the vrf lookup. Adjust pim to do the right thing with vrf lookup to be consistent and to make SA happier. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_iface.c')
-rw-r--r--pimd/pim_iface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 5dc64a1b3f..b2a8a6ff8f 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -797,7 +797,11 @@ void pim_if_addr_del_all(struct interface *ifp)
struct listnode *node;
struct listnode *nextnode;
struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
- struct pim_instance *pim = vrf->info;
+ struct pim_instance *pim;
+
+ if (!vrf)
+ return;
+ pim = vrf->info;
/* PIM/IGMP enabled ? */
if (!ifp->info)
@@ -860,12 +864,15 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
{
struct connected *ifc;
struct listnode *node;
- struct in_addr addr;
+ struct in_addr addr = {0};
int v4_addrs = 0;
int v6_addrs = 0;
struct pim_interface *pim_ifp = ifp->info;
struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
+ if (!vrf)
+ return addr;
+
if (pim_ifp && PIM_INADDR_ISNOT_ANY(pim_ifp->update_source)) {
return pim_ifp->update_source;
}