From: Donald Sharp Date: Wed, 24 Aug 2016 14:25:11 +0000 (-0400) Subject: pimd: Turn on forwarding for a late added interface. X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~264 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c8507a162475df2494125cb9a38aaf70cb96eb3b;p=mirror%2Ffrr.git pimd: Turn on forwarding for a late added interface. If we receive a join for a upstream interface that hasn't yet been added to pim for working under it, we never go back and add the forwarding on when we get the interface added to pim. Ticket: CM-11800 Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index dab2e0e1e7..867f59679a 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -407,6 +407,7 @@ void pim_if_addr_add(struct connected *ifc) if (pim_ifp->mroute_vif_index < 0) { pim_if_add_vif(ifp); } + pim_ifchannel_scan_forward_start (ifp); } } diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 85bd178d9b..e2b145a5b2 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -25,6 +25,7 @@ #include "thread.h" #include "memory.h" #include "if.h" +#include "vrf.h" #include "pimd.h" #include "pim_str.h" @@ -980,3 +981,41 @@ void pim_ifchannel_update_assert_tracking_desired(struct pim_ifchannel *ch) } } } + +/* + * If we have a new pim interface, check to + * see if any of the pre-existing channels have + * their upstream out that way and turn on forwarding + * for that ifchannel then. + */ +void +pim_ifchannel_scan_forward_start (struct interface *new_ifp) +{ + struct listnode *ifnode; + struct interface *ifp; + struct pim_interface *new_pim_ifp = new_ifp->info; + + for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) + { + struct pim_interface *loop_pim_ifp = ifp->info; + struct listnode *ch_node; + struct pim_ifchannel *ch; + + if (!loop_pim_ifp) + continue; + + if (new_pim_ifp == loop_pim_ifp) + continue; + + for (ALL_LIST_ELEMENTS_RO (loop_pim_ifp->pim_ifchannel_list, ch_node, ch)) + { + if (ch->ifjoin_state == PIM_IFJOIN_JOIN) + { + struct pim_upstream *up = ch->upstream; + if ((!up->channel_oil) && + (up->rpf.source_nexthop.interface == new_ifp)) + pim_forward_start (ch); + } + } + } +} diff --git a/pimd/pim_ifchannel.h b/pimd/pim_ifchannel.h index 7036131e56..0c39210642 100644 --- a/pimd/pim_ifchannel.h +++ b/pimd/pim_ifchannel.h @@ -136,4 +136,5 @@ void pim_ifchannel_update_could_assert(struct pim_ifchannel *ch); void pim_ifchannel_update_my_assert_metric(struct pim_ifchannel *ch); void pim_ifchannel_update_assert_tracking_desired(struct pim_ifchannel *ch); +void pim_ifchannel_scan_forward_start (struct interface *new_ifp); #endif /* PIM_IFCHANNEL_H */