diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-04-13 08:35:23 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-04-13 08:35:23 +0000 |
commit | f612135987c2b4408817b308f5bacdc921aa94f1 (patch) | |
tree | d75cf8154f31bc5b9784db50eefe9b076924d594 /usr.sbin/bgpctl/bgpctl.c | |
parent | 99ec66f4465e09dbfe034559fc31ec02c6fbc8a2 (diff) |
Show if a route is rejected or blackholed in show fib output. OK henning@
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 5ae21e3bf48..2dc668dae1b 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.76 2005/03/14 12:36:27 henning Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.77 2005/04/13 08:35:22 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -600,7 +600,8 @@ void show_fib_head(void) { printf("flags: * = valid, B = BGP, C = Connected, S = Static\n"); - printf(" N = BGP Nexthop reachable via this route\n\n"); + printf(" N = BGP Nexthop reachable via this route\n"); + printf(" r = reject route, b = blackhole route\n\n"); printf("flags destination gateway\n"); } @@ -643,7 +644,16 @@ show_fib_msg(struct imsg *imsg) else printf(" "); - printf(" "); + if (k->flags & F_REJECT && k->flags & F_BLACKHOLE) + printf("f"); + else if (k->flags & F_REJECT) + printf("r"); + else if (k->flags & F_BLACKHOLE) + printf("b"); + else + printf(" "); + + printf(" "); if (asprintf(&p, "%s/%u", inet_ntoa(k->prefix), k->prefixlen) == -1) err(1, NULL); |