diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-02-13 12:13:42 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-02-16 07:52:35 -0500 |
| commit | 312e29b0607f688ed30ba64d8a1fea7600967a72 (patch) | |
| tree | cf29143b72041c474698435a609c59a32e3b8338 /zebra/zebra_vty.c | |
| parent | bf9bc2e5f2213069801dd1445abc2bfa95214fdf (diff) | |
zebra: Remove code duplication for v4 and v6 versions of rib_match_multicast
a) Consolidate v4 and v6 versions of rib_match_multicast
b) Improve debug to show what we matched against as well.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 3b63821d37..d6009db0c6 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -164,27 +164,19 @@ DEFUN (show_ip_rpf, &ctx); } -DEFUN (show_ip_rpf_addr, +DEFPY (show_ip_rpf_addr, show_ip_rpf_addr_cmd, - "show ip rpf A.B.C.D", + "show ip rpf A.B.C.D$address", SHOW_STR IP_STR "Display RPF information for multicast source\n" "IP multicast source address (e.g. 10.0.0.0)\n") { - int idx_ipv4 = 3; - struct in_addr addr; struct route_node *rn; struct route_entry *re; - int ret; - - ret = inet_aton(argv[idx_ipv4]->arg, &addr); - if (ret == 0) { - vty_out(vty, "%% Malformed address\n"); - return CMD_WARNING; - } - re = rib_match_ipv4_multicast(VRF_DEFAULT, addr, &rn); + re = rib_match_multicast(AFI_IP, VRF_DEFAULT, (union g_addr *)&address, + &rn); if (re) vty_show_ip_route_detail(vty, rn, 1, false, false); |
