diff options
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_msdp.c | 10 | ||||
-rw-r--r-- | pimd/pim_msdp_packet.c | 18 | ||||
-rw-r--r-- | pimd/pim_zebra.c | 34 |
3 files changed, 25 insertions, 37 deletions
diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index b1b6958fe..623c14bb0 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -374,6 +374,8 @@ void pim_msdp_sa_ref(struct pim_instance *pim, struct pim_msdp_peer *mp, pim_sgaddr *sg, struct in_addr rp) { struct pim_msdp_sa *sa; + struct rp_info *rp_info; + struct prefix grp; sa = pim_msdp_sa_add(pim, sg, rp); if (!sa) { @@ -406,6 +408,14 @@ void pim_msdp_sa_ref(struct pim_instance *pim, struct pim_msdp_peer *mp, sa->sg_str); } /* send an immediate SA update to peers */ + pim_addr_to_prefix(&grp, sa->sg.grp); + rp_info = pim_rp_find_match_group(pim, &grp); + if (rp_info) { + sa->rp = rp_info->rp.rpf_addr; + } else + { + sa->rp = pim->msdp.originator_id; + } sa->rp = pim->msdp.originator_id; pim_msdp_pkt_sa_tx_one(sa); } diff --git a/pimd/pim_msdp_packet.c b/pimd/pim_msdp_packet.c index a414736cc..4324a96be 100644 --- a/pimd/pim_msdp_packet.c +++ b/pimd/pim_msdp_packet.c @@ -14,7 +14,9 @@ #include "pimd.h" #include "pim_instance.h" +#include "pim_rp.h" #include "pim_str.h" +#include "pim_util.h" #include "pim_errors.h" #include "pim_msdp.h" @@ -387,6 +389,9 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim, { struct listnode *sanode; struct pim_msdp_sa *sa; + struct rp_info *rp_info; + struct prefix group_all; + struct in_addr rp; int sa_count; int local_cnt = pim->msdp.local_cnt; @@ -395,8 +400,15 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim, zlog_debug(" sa gen %d", local_cnt); } - local_cnt = pim_msdp_pkt_sa_fill_hdr(pim, local_cnt, - pim->msdp.originator_id); + rp = pim->msdp.originator_id; + if (pim_get_all_mcast_group(&group_all)) { + rp_info = pim_rp_find_match_group(pim, &group_all); + if (rp_info) { + rp = rp_info->rp.rpf_addr; + } + } + + local_cnt = pim_msdp_pkt_sa_fill_hdr(pim, local_cnt, rp); for (ALL_LIST_ELEMENTS_RO(pim->msdp.sa_list, sanode, sa)) { if (!(sa->flags & PIM_MSDP_SAF_LOCAL)) { @@ -418,7 +430,7 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim, local_cnt); } local_cnt = pim_msdp_pkt_sa_fill_hdr( - pim, local_cnt, pim->msdp.originator_id); + pim, local_cnt, rp); } } diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 92dcbf9d1..62f00dbf8 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -51,39 +51,6 @@ static int pim_router_id_update_zebra(ZAPI_CALLBACK_ARGS) return 0; } -static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS) -{ - struct interface *ifp; - vrf_id_t new_vrf_id; - struct pim_instance *pim; - struct pim_interface *pim_ifp; - - ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id, - &new_vrf_id); - if (!ifp) - return 0; - - if (PIM_DEBUG_ZEBRA) - zlog_debug("%s: %s updating from %u to %u", __func__, ifp->name, - vrf_id, new_vrf_id); - - pim = pim_get_pim_instance(new_vrf_id); - if (!pim) - return 0; - - if_update_to_new_vrf(ifp, new_vrf_id); - - pim_ifp = ifp->info; - if (!pim_ifp) - return 0; - - pim_ifp->pim->mcast_if_count--; - pim_ifp->pim = pim; - pim_ifp->pim->mcast_if_count++; - - return 0; -} - #ifdef PIM_DEBUG_IFADDR_DUMP static void dump_if_address(struct interface *ifp) { @@ -463,7 +430,6 @@ static zclient_handler *const pim_handlers[] = { [ZEBRA_NEXTHOP_UPDATE] = pim_parse_nexthop_update, [ZEBRA_ROUTER_ID_UPDATE] = pim_router_id_update_zebra, - [ZEBRA_INTERFACE_VRF_UPDATE] = pim_zebra_interface_vrf_update, #if PIM_IPV == 4 [ZEBRA_VXLAN_SG_ADD] = pim_zebra_vxlan_sg_proc, |