From 15fe464b3276e32d212ea53b678a321b4a90dc5d Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 21 Jan 2020 11:16:36 +0000 Subject: 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@ --- usr.sbin/bgpctl/output.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.sbin') 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 @@ -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); -- cgit v1.2.3