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.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 92d21cf429..0fb7f176ce 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -47,6 +47,7 @@
#include "pim_nht.h"
#include "pim_jp_agg.h"
#include "pim_igmp_join.h"
+#include "pim_vxlan.h"
static void pim_if_igmp_join_del_all(struct interface *ifp);
static int igmp_join_sock(const char *ifname, ifindex_t ifindex,
@@ -109,7 +110,7 @@ static int pim_sec_addr_comp(const void *p1, const void *p2)
}
struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
- bool ispimreg)
+ bool ispimreg, bool is_vxlan_term)
{
struct pim_interface *pim_ifp;
@@ -178,7 +179,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
pim_sock_reset(ifp);
- pim_if_add_vif(ifp, ispimreg);
+ pim_if_add_vif(ifp, ispimreg, is_vxlan_term);
return pim_ifp;
}
@@ -628,7 +629,7 @@ void pim_if_addr_add(struct connected *ifc)
address assigned, then try to create a vif_index.
*/
if (pim_ifp->mroute_vif_index < 0) {
- pim_if_add_vif(ifp, false);
+ pim_if_add_vif(ifp, false, false /*vxlan_term*/);
}
pim_ifchannel_scan_forward_start(ifp);
}
@@ -761,7 +762,7 @@ void pim_if_addr_add_all(struct interface *ifp)
* address assigned, then try to create a vif_index.
*/
if (pim_ifp->mroute_vif_index < 0) {
- pim_if_add_vif(ifp, false);
+ pim_if_add_vif(ifp, false, false /*vxlan_term*/);
}
pim_ifchannel_scan_forward_start(ifp);
@@ -926,7 +927,7 @@ static int pim_iface_next_vif_index(struct interface *ifp)
see also pim_if_find_vifindex_by_ifindex()
*/
-int pim_if_add_vif(struct interface *ifp, bool ispimreg)
+int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)
{
struct pim_interface *pim_ifp = ifp->info;
struct in_addr ifaddr;
@@ -948,7 +949,7 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg)
}
ifaddr = pim_ifp->primary_address;
- if (!ispimreg && PIM_INADDR_IS_ANY(ifaddr)) {
+ if (!ispimreg && !is_vxlan_term && PIM_INADDR_IS_ANY(ifaddr)) {
zlog_warn(
"%s: could not get address for interface %s ifindex=%d",
__PRETTY_FUNCTION__, ifp->name, ifp->ifindex);
@@ -977,6 +978,10 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg)
}
pim_ifp->pim->iface_vif_index[pim_ifp->mroute_vif_index] = 1;
+
+ /* if the device qualifies as pim_vxlan iif/oif update vxlan entries */
+ pim_vxlan_add_vif(ifp);
+
return 0;
}
@@ -991,6 +996,9 @@ int pim_if_del_vif(struct interface *ifp)
return -1;
}
+ /* if the device was a pim_vxlan iif/oif update vxlan mroute entries */
+ pim_vxlan_del_vif(ifp);
+
pim_mroute_del_vif(ifp);
/*
@@ -1469,7 +1477,8 @@ void pim_if_create_pimreg(struct pim_instance *pim)
pim->regiface = if_create(pimreg_name, pim->vrf_id);
pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
- pim_if_new(pim->regiface, false, false, true);
+ pim_if_new(pim->regiface, false, false, true,
+ false /*vxlan_term*/);
}
}