summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-11-11 20:41:23 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2022-04-29 20:00:15 +0200
commit89fe7ba0cdb779bc65e80c01f0781bd32e2ffddc (patch)
tree5454d42f60e5e34492b4863c8541e22385fdd008 /pimd/pim_iface.c
parent23a8660ea488940729032d3d24652046f3a5c34d (diff)
pim6d: add fresh MLD implementation
Fresh ground-up MLD implementation with subscriber-tracking for MLDv2. Intended to be adapted for IPv4 and replace the IGMP implementation at a later point. Tested in ANVL, currently at 94/116. Some issues/TODOs are left in the code as CPP_NOTICE markers, but the code is very much good enough to proceed since otherwise we're blocked on overall PIM v6 progress. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_iface.c')
-rw-r--r--pimd/pim_iface.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index b98e64adfe..32ba1d926e 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -50,6 +50,8 @@
#include "pim_igmp_join.h"
#include "pim_vxlan.h"
+#include "pim6_mld.h"
+
#if PIM_IPV == 4
static void pim_if_igmp_join_del_all(struct interface *ifp);
static int igmp_join_sock(const char *ifname, ifindex_t ifindex,
@@ -650,6 +652,7 @@ void pim_if_addr_add(struct connected *ifc)
vxlan_term = pim_vxlan_is_term_dev_cfg(pim_ifp->pim, ifp);
pim_if_add_vif(ifp, false, vxlan_term);
}
+ gm_ifp_update(ifp);
pim_ifchannel_scan_forward_start(ifp);
}
@@ -762,6 +765,8 @@ void pim_if_addr_del(struct connected *ifc, int force_prim_as_any)
"%s: removed link-local %pI6, lowest now %pI6, highest %pI6",
ifc->ifp->name, &ifc->address->u.prefix6,
&pim_ifp->ll_lowest, &pim_ifp->ll_highest);
+
+ gm_ifp_update(ifp);
}
#endif
@@ -821,6 +826,7 @@ void pim_if_addr_add_all(struct interface *ifp)
vxlan_term = pim_vxlan_is_term_dev_cfg(pim_ifp->pim, ifp);
pim_if_add_vif(ifp, false, vxlan_term);
}
+ gm_ifp_update(ifp);
pim_ifchannel_scan_forward_start(ifp);
pim_rp_setup(pim_ifp->pim);
@@ -999,12 +1005,15 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)
}
ifaddr = pim_ifp->primary_address;
+#if PIM_IPV != 6
+ /* IPv6 API is always by interface index */
if (!ispimreg && !is_vxlan_term && pim_addr_is_any(ifaddr)) {
zlog_warn(
"%s: could not get address for interface %s ifindex=%d",
__func__, ifp->name, ifp->ifindex);
return -4;
}
+#endif
pim_ifp->mroute_vif_index = pim_iface_next_vif_index(ifp);
@@ -1029,9 +1038,10 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)
pim_ifp->pim->iface_vif_index[pim_ifp->mroute_vif_index] = 1;
+ gm_ifp_update(ifp);
+
/* if the device qualifies as pim_vxlan iif/oif update vxlan entries */
pim_vxlan_add_vif(ifp);
-
return 0;
}
@@ -1049,6 +1059,8 @@ int pim_if_del_vif(struct interface *ifp)
/* if the device was a pim_vxlan iif/oif update vxlan mroute entries */
pim_vxlan_del_vif(ifp);
+ gm_ifp_teardown(ifp);
+
pim_mroute_del_vif(ifp);
/*
@@ -1057,7 +1069,6 @@ int pim_if_del_vif(struct interface *ifp)
pim_ifp->pim->iface_vif_index[pim_ifp->mroute_vif_index] = 0;
pim_ifp->mroute_vif_index = -1;
-
return 0;
}