diff options
author | claudio <claudio@openbsd.org> | 2020-01-21 11:16:35 +0000 |
---|---|---|
committer | claudio <claudio@openbsd.org> | 2020-01-21 11:16:35 +0000 |
commit | d7a3f515e1ba9d0bd7f70a52e135efbb387cbff4 (patch) | |
tree | b3198e01b4f2bf296952203a02104528aa7fc5a3 /usr.sbin/bgpctl | |
parent | Update get_errstr() to report errors like log_notification() in bgpd. (diff) | |
download | wireguard-openbsd-d7a3f515e1ba9d0bd7f70a52e135efbb387cbff4.tar.xz wireguard-openbsd-d7a3f515e1ba9d0bd7f70a52e135efbb387cbff4.zip |
Report sent or received errors (normally not both at the same time).
With this the last notfication causing a session teardown will be shown
in bgpctl show neighbor output.
OK denis@ deraadt@
Diffstat (limited to 'usr.sbin/bgpctl')
-rw-r--r-- | usr.sbin/bgpctl/output.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c index e6ecafee456..89aede2ded8 100644 --- a/usr.sbin/bgpctl/output.c +++ b/usr.sbin/bgpctl/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.3 2020/01/09 11:57:04 claudio Exp $ */ +/* $OpenBSD: output.c,v 1.4 2020/01/21 11:16:35 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -221,12 +221,16 @@ show_neighbor_full(struct peer *p, struct parse_result *res) log_shutcomm(p->stats.last_shutcomm)); } if (p->state == STATE_IDLE) { - static const char *errstr; + const char *errstr; errstr = get_errstr(p->stats.last_sent_errcode, p->stats.last_sent_suberr); if (errstr) - printf(" Last error: %s\n\n", errstr); + printf(" Last error sent: %s\n\n", errstr); + errstr = get_errstr(p->stats.last_rcvd_errcode, + p->stats.last_rcvd_suberr); + if (errstr) + printf(" Last error received: %s\n\n", errstr); } else { printf(" Local host: %20s, Local port: %5u\n", log_addr(&p->local), p->local_port); |