diff options
author | Donald Sharp <donaldsharp72@gmail.com> | 2022-03-09 17:51:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-09 17:51:18 +0100 |
commit | 4f138d5d8a22003cd906777309734b54895d8524 (patch) | |
tree | d674d1ea91a442ce3e332bad902badeefb79d9e5 /pimd | |
parent | Merge pull request #10635 from anlancs/staticd-cross (diff) | |
parent | pim6d: reenable NHT code (diff) | |
download | frr-4f138d5d8a22003cd906777309734b54895d8524.tar.xz frr-4f138d5d8a22003cd906777309734b54895d8524.zip |
Merge pull request #10694 from opensourcerouting/pim6-nht-reenable
pim6d: reenable NHT code
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim6_stubs.c | 34 | ||||
-rw-r--r-- | pimd/pim_nht.c | 30 | ||||
-rw-r--r-- | pimd/pim_zebra.c | 3 | ||||
-rw-r--r-- | pimd/subdir.am | 2 |
4 files changed, 15 insertions, 54 deletions
diff --git a/pimd/pim6_stubs.c b/pimd/pim6_stubs.c index dab46b289..e689c7aca 100644 --- a/pimd/pim6_stubs.c +++ b/pimd/pim6_stubs.c @@ -29,40 +29,6 @@ /* * NH lookup / NHT */ -void pim_sendmsg_zebra_rnh(struct pim_instance *pim, struct zclient *zclient, - struct pim_nexthop_cache *pnc, int command) -{ -} - -int pim_ecmp_nexthop_lookup(struct pim_instance *pim, - struct pim_nexthop *nexthop, struct prefix *src, - struct prefix *grp, int neighbor_needed) -{ - return 0; -} - -int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr, - struct pim_upstream *up, struct rp_info *rp, - struct pim_nexthop_cache *out_pnc) -{ - return 0; -} - -void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr, - struct pim_upstream *up, struct rp_info *rp) -{ -} - -struct pim_nexthop_cache *pim_nexthop_cache_find(struct pim_instance *pim, - struct pim_rpf *rpf) -{ - return NULL; -} - -void pim_rp_nexthop_del(struct rp_info *rp_info) -{ -} - void pim_nht_bsr_add(struct pim_instance *pim, struct in_addr addr) { } diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 48dd565b2..80d214b2f 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -162,6 +162,7 @@ int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr, return 0; } +#if PIM_IPV == 4 void pim_nht_bsr_add(struct pim_instance *pim, struct in_addr addr) { struct pim_nexthop_cache *pnc; @@ -175,6 +176,7 @@ void pim_nht_bsr_add(struct pim_instance *pim, struct in_addr addr) pnc->bsr_count++; } +#endif /* PIM_IPV == 4 */ static void pim_nht_drop_maybe(struct pim_instance *pim, struct pim_nexthop_cache *pnc) @@ -244,6 +246,7 @@ void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr, pim_nht_drop_maybe(pim, pnc); } +#if PIM_IPV == 4 void pim_nht_bsr_del(struct pim_instance *pim, struct in_addr addr) { struct pim_nexthop_cache *pnc = NULL; @@ -398,6 +401,7 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, struct in_addr bsr_addr, } return false; } +#endif /* PIM_IPV == 4 */ void pim_rp_nexthop_del(struct rp_info *rp_info) { @@ -482,23 +486,13 @@ static int pim_update_upstream_nh(struct pim_instance *pim, uint32_t pim_compute_ecmp_hash(struct prefix *src, struct prefix *grp) { uint32_t hash_val; - uint32_t s = 0, g = 0; - if ((!src)) + if (!src) return 0; - switch (src->family) { - case AF_INET: { - s = src->u.prefix4.s_addr; - s = s == 0 ? 1 : s; - if (grp) - g = grp->u.prefix4.s_addr; - } break; - default: - break; - } - - hash_val = jhash_2words(g, s, 101); + hash_val = prefix_hash_key(src); + if (grp) + hash_val ^= prefix_hash_key(grp); return hash_val; } @@ -549,9 +543,9 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim, break; } - if (curr_route_valid - && !pim_if_connected_to_source(nexthop->interface, - src->u.prefix4)) { + if (curr_route_valid && + !pim_if_connected_to_source(nexthop->interface, + src_addr)) { nbr = pim_neighbor_find_prefix( nexthop->interface, &nexthop->mrib_nexthop_addr); @@ -668,7 +662,7 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim, nh_node->gate.ipv4; #else nexthop->mrib_nexthop_addr.u.prefix6 = - nh_node->gate->ipv6; + nh_node->gate.ipv6; #endif nexthop->mrib_metric_preference = pnc->distance; nexthop->mrib_route_metric = pnc->metric; diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 0acd3c069..3f418c087 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -454,10 +454,11 @@ static void pim_zebra_capabilities(struct zclient_capabilities *cap) static zclient_handler *const pim_handlers[] = { [ZEBRA_INTERFACE_ADDRESS_ADD] = pim_zebra_if_address_add, [ZEBRA_INTERFACE_ADDRESS_DELETE] = pim_zebra_if_address_del, + + [ZEBRA_NEXTHOP_UPDATE] = pim_parse_nexthop_update, #if PIM_IPV == 4 [ZEBRA_ROUTER_ID_UPDATE] = pim_router_id_update_zebra, [ZEBRA_INTERFACE_VRF_UPDATE] = pim_zebra_interface_vrf_update, - [ZEBRA_NEXTHOP_UPDATE] = pim_parse_nexthop_update, [ZEBRA_VXLAN_SG_ADD] = pim_zebra_vxlan_sg_proc, [ZEBRA_VXLAN_SG_DEL] = pim_zebra_vxlan_sg_proc, diff --git a/pimd/subdir.am b/pimd/subdir.am index 0fb5de7e0..d617be3cb 100644 --- a/pimd/subdir.am +++ b/pimd/subdir.am @@ -37,6 +37,7 @@ pim_common = \ pimd/pim_nb.c \ pimd/pim_nb_config.c \ pimd/pim_neighbor.c \ + pimd/pim_nht.c \ pimd/pim_oil.c \ pimd/pim_routemap.c \ pimd/pim_rp.c \ @@ -70,7 +71,6 @@ pimd_pimd_SOURCES = \ pimd/pim_msdp.c \ pimd/pim_msdp_packet.c \ pimd/pim_msdp_socket.c \ - pimd/pim_nht.c \ pimd/pim_pim.c \ pimd/pim_register.c \ pimd/pim_signals.c \ |