]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Add ability to see martian next-hop's for a vrf
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 3 Feb 2018 00:26:22 +0000 (19:26 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 3 Feb 2018 00:26:22 +0000 (19:26 -0500)
We've run across an issue where the local connected
ip address is not being removed in some error condition.
During trackdown it was noticed that we cannot look
at this table for views/vrf's.  While we don't have the
bug tracked down yet this will help us figure it out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_vty.c

index 4b9f4c639a9f1481c4daab19d921fb0c27fef274..0a0c3bc79f360501d356449530487fd6f5236c13 100644 (file)
@@ -6612,17 +6612,21 @@ static void bgp_show_martian_nexthops(struct vty *vty, struct bgp *bgp)
                     vty);
 }
 
-DEFUN(show_bgp_martian_nexthop_db,
-      show_bgp_martian_nexthop_db_cmd,
-      "show bgp martian next-hop",
-      SHOW_STR
-      BGP_STR
+DEFUN(show_bgp_martian_nexthop_db, show_bgp_martian_nexthop_db_cmd,
+      "show bgp [<view|vrf> VIEWVRFNAME] martian next-hop",
+      SHOW_STR BGP_STR BGP_INSTANCE_HELP_STR
       "martian next-hops\n"
       "martian next-hop database\n")
 {
        struct bgp *bgp = NULL;
+       int idx = 0;
+
+       if (argv_find(argv, argc, "view", &idx)
+           || argv_find(argv, argc, "vrf", &idx))
+               bgp = bgp_lookup_by_name(argv[idx + 1]->arg);
+       else
+               bgp = bgp_get_default();
 
-       bgp = bgp_get_default();
        if (!bgp) {
                vty_out(vty, "%% No BGP process is configured\n");
                return CMD_WARNING;