From: Donald Sharp Date: Thu, 8 Dec 2016 17:40:05 +0000 (-0500) Subject: pimd: Allow bridges and bonds to up and down X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~21 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ef71d1f860eff7b04623000a33766bf4c2e52a78;p=mirror%2Ffrr.git pimd: Allow bridges and bonds to up and down Bridges and bonds when ifdowned are removed from the kernel in it's entirety, while pim assumed that interfaces were kept around in some fashion. Basically when we had an ifdown event, for all ifchannels on that interface delete from the OIF. Also note the fact that the vif has gone away and we need to recreate it on the next ifup. Ticket: CM-13896 Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 0a104acef1..3c8bbac6ec 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -715,6 +715,17 @@ void pim_if_addr_add_all(struct interface *ifp) } } /* pim */ } + if (PIM_MROUTE_IS_ENABLED) { + /* + * PIM or IGMP is enabled on interface, and there is at least one + * address assigned, then try to create a vif_index. + */ + if (pim_ifp->mroute_vif_index < 0) { + pim_if_add_vif(ifp); + } + pim_ifchannel_scan_forward_start (ifp); + } + pim_rp_setup(); pim_rp_check_on_if_add(pim_ifp); } diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index efb1e3c65e..77d8e82eec 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -141,6 +141,23 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch) pim_ifp = ch->interface->info; + if (ch->upstream->channel_oil) + { + pim_channel_del_oif (ch->upstream->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_PIM); + /* + * Do we have any S,G's that are inheriting? + * Nuke from on high too. + */ + if (ch->upstream->sources) + { + struct pim_upstream *child; + struct listnode *up_node; + + for (ALL_LIST_ELEMENTS_RO (ch->upstream->sources, up_node, child)) + pim_channel_del_oif (child->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_PIM); + } + } + /* * When this channel is removed * we need to find all our children @@ -187,6 +204,8 @@ pim_ifchannel_delete_all (struct interface *ifp) struct pim_ifchannel *ifchannel; pim_ifp = ifp->info; + if (!pim_ifp) + return; for (ALL_LIST_ELEMENTS (pim_ifp->pim_ifchannel_list, ifchannel_node, ifchannel_nextnode, ifchannel)) diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 9d8c07cadb..41934074e1 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -174,6 +174,7 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient, } if (!if_is_operative(ifp)) { + pim_ifchannel_delete_all(ifp); /* pim_if_addr_del_all() suffices for shutting down IGMP, but not for shutting down PIM @@ -189,6 +190,9 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient, } } + if (ifp->info) + pim_if_del_vif(ifp); + return 0; }