diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-04-02 09:40:41 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-04-05 11:12:59 -0400 |
| commit | 43763b11d0d51b60809cddc4722daae359a4d1a9 (patch) | |
| tree | 4316e397b407dd65797e583d3947637893afed1d /pimd/pim_cmd.c | |
| parent | 5bd51314352b25420ef1c8df7265b95cdad88e37 (diff) | |
pimd: Tracking of RPF is *separate* from the lookup
Start the separation of tracking a Destination from the act
of looking it up. The cojoining of these two concepts led
to a bunch of code that had to think about both problems leading
to weird situations and code paths. Simplify the code by making
pim_ecmp_nexthop_search a static function and we only ever
call pim_ecmp_nexthop_lookup when we need to do a RPF().
pim_ecmp_nexthop_lookup will now attempt to find a stored pnc
and if it finds one it will report on the answer from it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_cmd.c')
| -rw-r--r-- | pimd/pim_cmd.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 1a30904e21..8d0ea12b8c 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -4257,7 +4257,6 @@ DEFUN (show_ip_pim_nexthop_lookup, "Source/RP address\n" "Multicast Group address\n") { - struct pim_nexthop_cache *pnc = NULL; struct prefix nht_p; int result = 0; struct in_addr src_addr, grp_addr; @@ -4269,7 +4268,6 @@ DEFUN (show_ip_pim_nexthop_lookup, char grp_str[PREFIX_STRLEN]; int idx = 2; struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx); - struct pim_rpf rpf; if (!vrf) return CMD_WARNING; @@ -4315,18 +4313,7 @@ DEFUN (show_ip_pim_nexthop_lookup, grp.u.prefix4 = grp_addr; memset(&nexthop, 0, sizeof(nexthop)); - memset(&rpf, 0, sizeof(struct pim_rpf)); - rpf.rpf_addr.family = AF_INET; - rpf.rpf_addr.prefixlen = IPV4_MAX_BITLEN; - rpf.rpf_addr.u.prefix4 = vif_source; - - pnc = pim_nexthop_cache_find(vrf->info, &rpf); - if (pnc) - result = pim_ecmp_nexthop_search(vrf->info, pnc, &nexthop, - &nht_p, &grp, 0); - else - result = pim_ecmp_nexthop_lookup(vrf->info, &nexthop, &nht_p, - &grp, 0); + result = pim_ecmp_nexthop_lookup(vrf->info, &nexthop, &nht_p, &grp, 0); if (!result) { vty_out(vty, |
