From: claudio Date: Wed, 29 Aug 2018 19:52:23 +0000 (+0000) Subject: Introduce 'bgpctl show rib error' to show all prefixes that got flagged X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=79dfb877839cab77ad12f3f45b88fcbc33df163a;p=openbsd Introduce 'bgpctl show rib error' to show all prefixes that got flagged invalid because of a soft parsing error. These prefixes are never eligible or valid but the listing may help to understand what is going on. 'bgpctl show rib error' run automatically on Adj-RIB-In since that is the only RIB that has such prefixes. OK sthen@ denis@ --- diff --git a/usr.sbin/bgpctl/bgpctl.8 b/usr.sbin/bgpctl/bgpctl.8 index 38fd56c895e..098bcc12c55 100644 --- a/usr.sbin/bgpctl/bgpctl.8 +++ b/usr.sbin/bgpctl/bgpctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpctl.8,v 1.79 2017/10/15 20:44:21 deraadt Exp $ +.\" $OpenBSD: bgpctl.8,v 1.80 2018/08/29 19:52:23 claudio Exp $ .\" .\" Copyright (c) 2003 Henning Brauer .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 15 2017 $ +.Dd $Mdocdate: August 29 2018 $ .Dt BGPCTL 8 .Os .Sh NAME @@ -363,6 +363,8 @@ are defined: .It Cm best Alias for .Ic selected . +.It Cm error +Show only prefixes which are marked invalid and are treated as withdraw. .It Cm selected Show only selected routes. .It Cm ssv @@ -376,9 +378,6 @@ Show more detailed output for matching routes. Limit the output to the given address family. .It Cm in Show routes from the unfiltered Adj-RIB-In. -This is only possible if -.Em softreconfig in -is enabled for the neighbor. The .Cm neighbor needs to be specified. diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 5d490b1076b..75778d80551 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.210 2018/07/29 13:02:01 deraadt Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.211 2018/08/29 19:52:23 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -1181,8 +1181,8 @@ show_interface_msg(struct imsg *imsg) void show_rib_summary_head(void) { - printf("flags: * = Valid, > = Selected, I = via IBGP, A = Announced, " - "S = Stale\n"); + printf("flags: * = Valid, > = Selected, I = via IBGP, A = Announced,\n" + " S = Stale, E = Error\n"); printf("origin: i = IGP, e = EGP, ? = Incomplete\n\n"); printf("%-5s %-20s %-15s %5s %5s %s\n", "flags", "destination", "gateway", "lpref", "med", "aspath origin"); @@ -1222,6 +1222,8 @@ print_flags(u_int8_t flags, int sum) char *p = flagstr; if (sum) { + if (flags & F_PREF_INVALID) + *p++ = 'E'; if (flags & F_PREF_ANNOUNCE) *p++ = 'A'; if (flags & F_PREF_INTERNAL) diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 7435538e0cc..6b27d1d6efa 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.82 2018/07/10 13:03:06 benno Exp $ */ +/* $OpenBSD: parser.c,v 1.83 2018/08/29 19:52:23 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -177,6 +177,7 @@ static const struct token t_show_rib[] = { { FLAG, "best", F_CTL_ACTIVE, t_show_rib}, { FLAG, "selected", F_CTL_ACTIVE, t_show_rib}, { FLAG, "detail", F_CTL_DETAIL, t_show_rib}, + { FLAG, "error", F_CTL_INVALID, t_show_rib}, { FLAG, "ssv" , F_CTL_SSV, t_show_rib}, { FLAG, "in", F_CTL_ADJ_IN, t_show_rib}, { FLAG, "out", F_CTL_ADJ_OUT, t_show_rib},