summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_iface.c')
-rw-r--r--pimd/pim_iface.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 738a548c7c..e03e5a2630 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -633,9 +633,7 @@ void pim_if_addr_add(struct connected *ifc)
with RNH address to receive update and add the
interface as nexthop. */
memset(&rpf, 0, sizeof(struct pim_rpf));
- rpf.rpf_addr.family = AF_INET;
- rpf.rpf_addr.prefixlen = IPV4_MAX_BITLEN;
- rpf.rpf_addr.u.prefix4 = ifc->address->u.prefix4;
+ rpf.rpf_addr = pim_addr_from_prefix(ifc->address);
pnc = pim_nexthop_cache_find(pim_ifp->pim, &rpf);
if (pnc)
pim_sendmsg_zebra_rnh(pim_ifp->pim, zclient,
@@ -801,22 +799,13 @@ void pim_if_addr_add_all(struct interface *ifp)
pim_if_addr_add(ifc);
}
- if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) {
- if (pim_ifp->pim_enable) {
-
- /* Interface has a valid primary address ? */
- if (!pim_addr_is_any(pim_ifp->primary_address)) {
-
- /* Interface has a valid socket ? */
- if (pim_ifp->pim_sock_fd < 0) {
- if (pim_sock_add(ifp)) {
- zlog_warn(
- "Failure creating PIM socket for interface %s",
- ifp->name);
- }
- }
- }
- } /* pim */
+ if (!v4_addrs && v6_addrs && !if_is_loopback(ifp) &&
+ pim_ifp->pim_enable && !pim_addr_is_any(pim_ifp->primary_address) &&
+ pim_ifp->pim_sock_fd < 0 && pim_sock_add(ifp)) {
+ /* Interface has a valid primary address ? */
+ /* Interface has a valid socket ? */
+ zlog_warn("Failure creating PIM socket for interface %s",
+ ifp->name);
}
/*
* PIM or IGMP/MLD is enabled on interface, and there is at least one
@@ -1768,9 +1757,7 @@ static int pim_ifp_down(struct interface *ifp)
if (ifp->info) {
pim_if_del_vif(ifp);
-#if PIM_IPV == 4
pim_ifstat_reset(ifp);
-#endif
}
return 0;