summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-03 00:23:11 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:51:38 +0200
commit11699c47885e64a7e48576cb5a6e220c346f071f (patch)
tree7c6e2211726c970ee674e4542c415f8d015d4b50
parentpimd: We may receive a igmp packet in on unconfiged intf (diff)
downloadfrr-11699c47885e64a7e48576cb5a6e220c346f071f.tar.xz
frr-11699c47885e64a7e48576cb5a6e220c346f071f.zip
pimd: Don't send hello's out vrf interface
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-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)) {