summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_iface.c11
-rw-r--r--pimd/pim_nht.c6
-rw-r--r--pimd/pim_zebra.c6
3 files changed, 19 insertions, 4 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;
}
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c
index 8f9058d994..e2984e1d13 100644
--- a/pimd/pim_nht.c
+++ b/pimd/pim_nht.c
@@ -648,7 +648,11 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
struct interface *ifp = NULL;
struct interface *ifp1 = NULL;
struct vrf *vrf = vrf_lookup_by_id(vrf_id);
- struct pim_instance *pim = vrf->info;
+ struct pim_instance *pim;
+
+ if (!vrf)
+ return 0;
+ pim = vrf->info;
s = zclient->ibuf;
memset(&p, 0, sizeof(struct prefix));
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 8c90ccbed1..bee6521b6c 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -348,7 +348,11 @@ static int pim_zebra_if_address_del(int command, struct zclient *client,
struct connected *c;
struct prefix *p;
struct vrf *vrf = vrf_lookup_by_id(vrf_id);
- struct pim_instance *pim = vrf->info;
+ struct pim_instance *pim;
+
+ if (!vrf)
+ return 0;
+ pim = vrf->info;
/*
zebra api notifies address adds/dels events by using the same call