From: Donald Sharp Date: Fri, 2 Jun 2017 22:23:11 +0000 (-0400) Subject: pimd: Don't send hello's out vrf interface X-Git-Tag: frr-4.0-dev~468^2~68 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=11699c47885e64a7e48576cb5a6e220c346f071f;p=mirror%2Ffrr.git pimd: Don't send hello's out vrf interface Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 2d8b2b7979..19747ebcb3 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 703b83b05d..7eff299023 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 8840abd888..be5bcee5db 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)) {