summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-01-21 11:16:36 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-01-21 11:16:36 +0000
commit15fe464b3276e32d212ea53b678a321b4a90dc5d (patch)
tree0c59cbd17f7ef3796b0df2fd53e630ea840f78d6 /usr.sbin
parente5c34daa41766a737922f99c92b1323abe6e5d09 (diff)
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')
-rw-r--r--usr.sbin/bgpctl/output.c10
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);