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.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index cb31878e01..07c4172f22 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;
}
@@ -1583,8 +1589,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;
}