diff options
Diffstat (limited to 'pimd/pim_iface.c')
| -rw-r--r-- | pimd/pim_iface.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index cb31878e01..95b81d5dcb 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -186,6 +186,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim, pim_sock_reset(ifp); pim_if_add_vif(ifp, ispimreg, is_vxlan_term); + pim_ifp->pim->mcast_if_count++; return pim_ifp; } @@ -209,6 +210,7 @@ void pim_if_delete(struct interface *ifp) pim_neighbor_delete_all(ifp, "Interface removed from configuration"); pim_if_del_vif(ifp); + pim_ifp->pim->mcast_if_count--; list_delete(&pim_ifp->igmp_socket_list); list_delete(&pim_ifp->pim_neighbor_list); @@ -275,7 +277,7 @@ static void pim_addr_change(struct interface *ifp) 1) Before an interface goes down or changes primary IP address, a Hello message with a zero HoldTime should be sent immediately (with the old IP address if the IP address changed). - -- FIXME See CAVEAT C13 + -- Done at the caller of the function as new ip already updated here 2) After an interface has changed its IP address, it MUST send a Hello message with its new IP address. @@ -320,6 +322,10 @@ static int detect_primary_address_change(struct interface *ifp, } if (changed) { + /* Before updating pim_ifp send Hello time with 0 hold time */ + if (PIM_IF_TEST_PIM(pim_ifp->options)) { + pim_hello_send(ifp, 0 /* zero-sec holdtime */); + } pim_ifp->primary_address = new_prim_addr; } @@ -894,15 +900,16 @@ struct in_addr pim_find_primary_addr(struct interface *ifp) * So let's grab the loopbacks v4 address * and use that as the primary address */ - if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) { + if (!v4_addrs && v6_addrs) { struct interface *lo_ifp; + // DBS - Come back and check here if (ifp->vrf_id == VRF_DEFAULT) lo_ifp = if_lookup_by_name("lo", vrf->vrf_id); else lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id); - if (lo_ifp) + if (lo_ifp && (lo_ifp != ifp)) return pim_find_primary_addr(lo_ifp); } @@ -1583,8 +1590,14 @@ int pim_ifp_create(struct interface *ifp) } if (!strncmp(ifp->name, PIM_VXLAN_TERM_DEV_NAME, - sizeof(PIM_VXLAN_TERM_DEV_NAME))) - pim_vxlan_add_term_dev(pim, ifp); + sizeof(PIM_VXLAN_TERM_DEV_NAME))) { + if (pim->mcast_if_count < MAXVIFS) + pim_vxlan_add_term_dev(pim, ifp); + else + zlog_warn( + "%s: Cannot enable pim on %s. MAXVIFS(%d) reached. Deleting and readding the vxlan termimation device after unconfiguring pim from other interfaces may succeed.", + __func__, ifp->name, MAXVIFS); + } return 0; } |
