summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_iface.c11
-rw-r--r--pimd/pim_iface.h1
-rw-r--r--pimd/pim_pim.c8
3 files changed, 14 insertions, 6 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 2d8b2b797..19747ebcb 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -1582,3 +1582,14 @@ int pim_if_connected_to_source(struct interface *ifp, struct in_addr src)
return 0;
}
+
+int pim_if_is_loopback(struct pim_instance *pim, struct interface *ifp)
+{
+ if (if_is_loopback(ifp))
+ return 1;
+
+ if (strcmp(ifp->name, pim->vrf->name) == 0)
+ return 1;
+
+ return 0;
+}
diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h
index 703b83b05..7eff29902 100644
--- a/pimd/pim_iface.h
+++ b/pimd/pim_iface.h
@@ -205,4 +205,5 @@ void pim_if_create_pimreg(struct pim_instance *pim);
int pim_if_connected_to_source(struct interface *ifp, struct in_addr src);
int pim_update_source_set(struct interface *ifp, struct in_addr source);
+int pim_if_is_loopback(struct pim_instance *pim, struct interface *ifp);
#endif /* PIM_IFACE_H */
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 8840abd88..be5bcee5d 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -667,13 +667,9 @@ static int hello_send(struct interface *ifp, uint16_t holdtime)
static int pim_hello_send(struct interface *ifp, uint16_t holdtime)
{
- struct pim_interface *pim_ifp;
-
- zassert(ifp);
- pim_ifp = ifp->info;
- zassert(pim_ifp);
+ struct pim_interface *pim_ifp = ifp->info;
- if (if_is_loopback(ifp))
+ if (pim_if_is_loopback(pim_ifp->pim, ifp))
return 0;
if (hello_send(ifp, holdtime)) {