summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-05-10 13:38:46 +0000
committerderaadt <deraadt@openbsd.org>2020-05-10 13:38:46 +0000
commita78f83ce721c25bb7a3c00a20e2c8bec5a6f6e48 (patch)
tree6c0d79bf26707e5efa4042897f1b0f191b33bd3b /usr.sbin
parentAllow to have multiple domain ... {} sextions with the same domain (diff)
downloadwireguard-openbsd-a78f83ce721c25bb7a3c00a20e2c8bec5a6f6e48.tar.xz
wireguard-openbsd-a78f83ce721c25bb7a3c00a20e2c8bec5a6f6e48.zip
In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')
to be more generic, then change 'reload' to take take a '[reason]' also, which will be logged by bgpd. ok kn claudio
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpctl/bgpctl.86
-rw-r--r--usr.sbin/bgpctl/bgpctl.c32
-rw-r--r--usr.sbin/bgpctl/output.c10
-rw-r--r--usr.sbin/bgpctl/output_json.c10
-rw-r--r--usr.sbin/bgpctl/parser.c27
-rw-r--r--usr.sbin/bgpctl/parser.h4
-rw-r--r--usr.sbin/bgpd/bgpd.c6
-rw-r--r--usr.sbin/bgpd/bgpd.h10
-rw-r--r--usr.sbin/bgpd/control.c16
-rw-r--r--usr.sbin/bgpd/parse.y8
-rw-r--r--usr.sbin/bgpd/session.c40
-rw-r--r--usr.sbin/bgpd/session.h4
-rw-r--r--usr.sbin/bgpd/util.c6
13 files changed, 94 insertions, 85 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.8 b/usr.sbin/bgpctl/bgpctl.8
index cbc5eb45ac2..4b61250703a 100644
--- a/usr.sbin/bgpctl/bgpctl.8
+++ b/usr.sbin/bgpctl/bgpctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgpctl.8,v 1.94 2020/05/02 14:45:40 claudio Exp $
+.\" $OpenBSD: bgpctl.8,v 1.95 2020/05/10 13:38:46 deraadt Exp $
.\"
.\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
.\"
@@ -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: May 2 2020 $
+.Dd $Mdocdate: May 10 2020 $
.Dt BGPCTL 8
.Os
.Sh NAME
@@ -171,7 +171,7 @@ The supported families are
.Em inet
and
.Em inet6 .
-.It Cm reload
+.It Cm reload Op reason
Reload the configuration file.
Changes to the following neighbor options in
.Xr bgpd.conf 5
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 085fe5c68b7..d74219b2d1e 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.262 2020/05/02 14:33:33 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.263 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -120,7 +120,7 @@ main(int argc, char *argv[])
memcpy(&neighbor.addr, &res->peeraddr, sizeof(neighbor.addr));
strlcpy(neighbor.descr, res->peerdesc, sizeof(neighbor.descr));
neighbor.is_group = res->is_group;
- strlcpy(neighbor.shutcomm, res->shutcomm, sizeof(neighbor.shutcomm));
+ strlcpy(neighbor.reason, res->reason, sizeof(neighbor.reason));
switch (res->action) {
case SHOW_MRT:
@@ -246,8 +246,12 @@ main(int argc, char *argv[])
imsg_compose(ibuf, IMSG_CTL_SHOW_RIB_MEM, 0, 0, -1, NULL, 0);
break;
case RELOAD:
- imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1, NULL, 0);
- printf("reload request sent.\n");
+ imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1,
+ res->reason, sizeof(res->reason));
+ if (res->reason[0])
+ printf("reload request sent: %s\n", res->reason);
+ else
+ printf("reload request sent.\n");
break;
case FIB:
errx(1, "action==FIB");
@@ -1459,8 +1463,8 @@ show_mrt_notification(u_char *p, u_int16_t len)
{
u_int16_t i;
u_int8_t errcode, subcode;
- size_t shutcomm_len;
- char shutcomm[SHUT_COMM_LEN];
+ size_t reason_len;
+ char reason[REASON_LEN];
memcpy(&errcode, p, sizeof(errcode));
p += sizeof(errcode);
@@ -1476,22 +1480,22 @@ show_mrt_notification(u_char *p, u_int16_t len)
if (errcode == ERR_CEASE && (subcode == ERR_CEASE_ADMIN_DOWN ||
subcode == ERR_CEASE_ADMIN_RESET)) {
if (len > 1) {
- shutcomm_len = *p++;
+ reason_len = *p++;
len--;
- if (len < shutcomm_len) {
+ if (len < reason_len) {
printf("truncated shutdown reason");
return;
}
- if (shutcomm_len > SHUT_COMM_LEN - 1) {
+ if (reason_len > REASON_LEN - 1) {
printf("overly long shutdown reason");
return;
}
- memcpy(shutcomm, p, shutcomm_len);
- shutcomm[shutcomm_len] = '\0';
+ memcpy(reason, p, reason_len);
+ reason[reason_len] = '\0';
printf("shutdown reason: \"%s\"",
- log_shutcomm(shutcomm));
- p += shutcomm_len;
- len -= shutcomm_len;
+ log_reason(reason));
+ p += reason_len;
+ len -= reason_len;
}
}
if (errcode == ERR_OPEN && subcode == ERR_OPEN_CAPA) {
diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c
index 1aa5835c383..ead6d9f068a 100644
--- a/usr.sbin/bgpctl/output.c
+++ b/usr.sbin/bgpctl/output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: output.c,v 1.8 2020/05/02 14:28:10 claudio Exp $ */
+/* $OpenBSD: output.c,v 1.9 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -261,9 +261,9 @@ show_neighbor_full(struct peer *p, struct parse_result *res)
if (p->conf.down) {
printf(", marked down");
}
- if (*(p->conf.shutcomm)) {
+ if (*(p->conf.reason)) {
printf(" with shutdown reason \"%s\"",
- log_shutcomm(p->conf.shutcomm));
+ log_reason(p->conf.reason));
}
if (p->stats.last_updown != 0)
printf(", %s for %s",
@@ -296,9 +296,9 @@ show_neighbor_full(struct peer *p, struct parse_result *res)
show_neighbor_msgstats(p);
printf("\n");
- if (*(p->stats.last_shutcomm)) {
+ if (*(p->stats.last_reason)) {
printf(" Last received shutdown reason: \"%s\"\n",
- log_shutcomm(p->stats.last_shutcomm));
+ log_reason(p->stats.last_reason));
}
errstr = fmt_errstr(p->stats.last_sent_errcode,
diff --git a/usr.sbin/bgpctl/output_json.c b/usr.sbin/bgpctl/output_json.c
index 762e0d17385..5c7f611f88a 100644
--- a/usr.sbin/bgpctl/output_json.c
+++ b/usr.sbin/bgpctl/output_json.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: output_json.c,v 1.2 2020/05/03 18:34:34 claudio Exp $ */
+/* $OpenBSD: output_json.c,v 1.3 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@@ -201,12 +201,12 @@ json_neighbor_full(struct peer *p)
json_neighbor_stats(p);
/* errors */
- if (*(p->conf.shutcomm))
+ if (*(p->conf.reason))
json_do_printf("my_shutdown_reason", "%s",
- log_shutcomm(p->conf.shutcomm));
- if (*(p->stats.last_shutcomm))
+ log_reason(p->conf.reason));
+ if (*(p->stats.last_reason))
json_do_printf("last_shutdown_reason", "%s",
- log_shutcomm(p->stats.last_shutcomm));
+ log_reason(p->stats.last_reason));
errstr = fmt_errstr(p->stats.last_sent_errcode,
p->stats.last_sent_suberr);
if (errstr)
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 2c61bec6826..7a4b478f6f8 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.101 2020/01/22 07:52:38 deraadt Exp $ */
+/* $OpenBSD: parser.c,v 1.102 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -46,7 +46,7 @@ enum token_type {
PEERDESC,
GROUPDESC,
RIBNAME,
- SHUTDOWN_COMMUNICATION,
+ COMMUNICATION,
COMMUNITY,
EXTCOMMUNITY,
EXTCOM_SUBTYPE,
@@ -114,9 +114,10 @@ static const struct token t_weight[];
static const struct token t_log[];
static const struct token t_fib_table[];
static const struct token t_show_fib_table[];
+static const struct token t_communication[];
static const struct token t_main[] = {
- { KEYWORD, "reload", RELOAD, NULL},
+ { KEYWORD, "reload", RELOAD, t_communication},
{ KEYWORD, "show", SHOW, t_show},
{ KEYWORD, "fib", FIB, t_fib},
{ KEYWORD, "neighbor", NEIGHBOR, t_neighbor},
@@ -276,16 +277,16 @@ static const struct token t_neighbor[] = {
{ ENDTOKEN, "", NONE, NULL}
};
-static const struct token t_nei_mod_shutc[] = {
+static const struct token t_communication[] = {
{ NOTOKEN, "", NONE, NULL},
- { SHUTDOWN_COMMUNICATION, "", NONE, NULL},
+ { COMMUNICATION, "", NONE, NULL},
{ ENDTOKEN, "", NONE, NULL}
};
static const struct token t_neighbor_modifiers[] = {
{ KEYWORD, "up", NEIGHBOR_UP, NULL},
- { KEYWORD, "down", NEIGHBOR_DOWN, t_nei_mod_shutc},
- { KEYWORD, "clear", NEIGHBOR_CLEAR, t_nei_mod_shutc},
+ { KEYWORD, "down", NEIGHBOR_DOWN, t_communication},
+ { KEYWORD, "clear", NEIGHBOR_CLEAR, t_communication},
{ KEYWORD, "refresh", NEIGHBOR_RREFRESH, NULL},
{ KEYWORD, "destroy", NEIGHBOR_DESTROY, NULL},
{ ENDTOKEN, "", NONE, NULL}
@@ -644,11 +645,11 @@ match_token(int *argc, char **argv[], const struct token table[])
t = &table[i];
}
break;
- case SHUTDOWN_COMMUNICATION:
+ case COMMUNICATION:
if (!match && word != NULL && wordlen > 0) {
- if (strlcpy(res.shutcomm, word,
- sizeof(res.shutcomm)) >=
- sizeof(res.shutcomm))
+ if (strlcpy(res.reason, word,
+ sizeof(res.reason)) >=
+ sizeof(res.reason))
errx(1, "shutdown reason too long");
match++;
t = &table[i];
@@ -846,8 +847,8 @@ show_valid_args(const struct token table[])
case RIBNAME:
fprintf(stderr, " <rib name>\n");
break;
- case SHUTDOWN_COMMUNICATION:
- fprintf(stderr, " <shutdown reason>\n");
+ case COMMUNICATION:
+ fprintf(stderr, " <reason>\n");
break;
case COMMUNITY:
fprintf(stderr, " <community>\n");
diff --git a/usr.sbin/bgpctl/parser.h b/usr.sbin/bgpctl/parser.h
index 47e0eeba0d2..7789bdcc206 100644
--- a/usr.sbin/bgpctl/parser.h
+++ b/usr.sbin/bgpctl/parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.h,v 1.37 2019/06/25 07:44:20 claudio Exp $ */
+/* $OpenBSD: parser.h,v 1.38 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -64,7 +64,7 @@ struct parse_result {
struct community community;
char peerdesc[PEER_DESCR_LEN];
char rib[PEER_DESCR_LEN];
- char shutcomm[SHUT_COMM_LEN];
+ char reason[REASON_LEN];
const char *ext_comm_subtype;
u_int64_t rd;
int flags;
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index e8836230326..ef2142f4fa0 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.227 2019/10/02 08:58:34 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.228 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -829,6 +829,10 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct bgpd_config *conf)
else {
reconfig = 1;
reconfpid = imsg.hdr.pid;
+ if (imsg.hdr.len == IMSG_HEADER_SIZE + REASON_LEN &&
+ ((char *)imsg.data)[0])
+ log_info("reload due to: %.*s",
+ REASON_LEN, log_reason(imsg.data));
}
break;
case IMSG_CTL_FIB_COUPLE:
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 3876b9e125c..7d081693cef 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.402 2020/04/23 16:13:11 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.403 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -38,7 +38,7 @@
#define CONFFILE "/etc/bgpd.conf"
#define BGPD_USER "_bgpd"
#define PEER_DESCR_LEN 32
-#define SHUT_COMM_LEN 256 /* includes NUL terminator */
+#define REASON_LEN 256 /* includes NUL terminator */
#define PFTABLE_LEN 32
#define TCP_MD5_KEY_LEN 80
#define IPSEC_ENC_KEY_LEN 32
@@ -371,7 +371,7 @@ struct peer_config {
struct capabilities capabilities;
char group[PEER_DESCR_LEN];
char descr[PEER_DESCR_LEN];
- char shutcomm[SHUT_COMM_LEN];
+ char reason[REASON_LEN];
char rib[PEER_DESCR_LEN];
char if_depend[IFNAMSIZ];
char demote_group[IFNAMSIZ];
@@ -699,7 +699,7 @@ struct ctl_show_nexthop {
struct ctl_neighbor {
struct bgpd_addr addr;
char descr[PEER_DESCR_LEN];
- char shutcomm[SHUT_COMM_LEN];
+ char reason[REASON_LEN];
int show_timers;
int is_group;
};
@@ -1305,7 +1305,7 @@ const char *log_sockaddr(struct sockaddr *, socklen_t);
const char *log_as(u_int32_t);
const char *log_rd(u_int64_t);
const char *log_ext_subtype(short, u_int8_t);
-const char *log_shutcomm(const char *);
+const char *log_reason(const char *);
int aspath_snprint(char *, size_t, void *, u_int16_t);
int aspath_asprint(char **, void *, u_int16_t);
size_t aspath_strlen(void *, u_int16_t);
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 433bbee096c..2b9ebdc8a9a 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.99 2019/08/12 15:02:05 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.100 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -375,7 +375,7 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt,
case IMSG_CTL_NEIGHBOR_UP:
bgp_fsm(p, EVNT_START);
p->conf.down = 0;
- p->conf.shutcomm[0] = '\0';
+ p->conf.reason[0] = '\0';
p->IdleHoldTime =
INTERVAL_IDLE_HOLD_INITIAL;
p->errcnt = 0;
@@ -383,16 +383,16 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt,
break;
case IMSG_CTL_NEIGHBOR_DOWN:
p->conf.down = 1;
- strlcpy(p->conf.shutcomm,
- neighbor->shutcomm,
- sizeof(neighbor->shutcomm));
+ strlcpy(p->conf.reason,
+ neighbor->reason,
+ sizeof(neighbor->reason));
session_stop(p, ERR_CEASE_ADMIN_DOWN);
control_result(c, CTL_RES_OK);
break;
case IMSG_CTL_NEIGHBOR_CLEAR:
- strlcpy(p->conf.shutcomm,
- neighbor->shutcomm,
- sizeof(neighbor->shutcomm));
+ strlcpy(p->conf.reason,
+ neighbor->reason,
+ sizeof(neighbor->reason));
p->IdleHoldTime =
INTERVAL_IDLE_HOLD_INITIAL;
p->errcnt = 0;
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index a2d98aff687..66f6eaad148 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.407 2020/05/08 07:44:17 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.408 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1297,9 +1297,9 @@ peeropts : REMOTEAS as4number {
}
| DOWN STRING {
curpeer->conf.down = 1;
- if (strlcpy(curpeer->conf.shutcomm, $2,
- sizeof(curpeer->conf.shutcomm)) >=
- sizeof(curpeer->conf.shutcomm)) {
+ if (strlcpy(curpeer->conf.reason, $2,
+ sizeof(curpeer->conf.reason)) >=
+ sizeof(curpeer->conf.reason)) {
yyerror("shutdown reason too long");
free($2);
YYERROR;
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index c92a5132c1f..4930c38e999 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.400 2020/04/23 16:13:11 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.401 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -516,9 +516,9 @@ session_main(int debug, int verbose)
RB_FOREACH_SAFE(p, peer_head, &conf->peers, next) {
RB_REMOVE(peer_head, &conf->peers, p);
- strlcpy(p->conf.shutcomm,
+ strlcpy(p->conf.reason,
"bgpd shutting down",
- sizeof(p->conf.shutcomm));
+ sizeof(p->conf.reason));
session_stop(p, ERR_CEASE_ADMIN_DOWN);
timer_remove_all(p);
free(p);
@@ -2242,7 +2242,7 @@ parse_notification(struct peer *peer)
u_int8_t subcode;
u_int8_t capa_code;
u_int8_t capa_len;
- size_t shutcomm_len;
+ size_t reason_len;
u_int8_t i;
/* just log */
@@ -2343,25 +2343,25 @@ parse_notification(struct peer *peer)
(subcode == ERR_CEASE_ADMIN_DOWN ||
subcode == ERR_CEASE_ADMIN_RESET)) {
if (datalen > 1) {
- shutcomm_len = *p++;
+ reason_len = *p++;
datalen--;
- if (datalen < shutcomm_len) {
+ if (datalen < reason_len) {
log_peer_warnx(&peer->conf,
"received truncated shutdown reason");
return (0);
}
- if (shutcomm_len > SHUT_COMM_LEN - 1) {
+ if (reason_len > REASON_LEN - 1) {
log_peer_warnx(&peer->conf,
"received overly long shutdown reason");
return (0);
}
- memcpy(peer->stats.last_shutcomm, p, shutcomm_len);
- peer->stats.last_shutcomm[shutcomm_len] = '\0';
+ memcpy(peer->stats.last_reason, p, reason_len);
+ peer->stats.last_reason[reason_len] = '\0';
log_peer_warnx(&peer->conf,
"received shutdown reason: \"%s\"",
- log_shutcomm(peer->stats.last_shutcomm));
- p += shutcomm_len;
- datalen -= shutcomm_len;
+ log_reason(peer->stats.last_reason));
+ p += reason_len;
+ datalen -= reason_len;
}
}
@@ -3222,25 +3222,25 @@ session_demote(struct peer *p, int level)
void
session_stop(struct peer *peer, u_int8_t subcode)
{
- char data[SHUT_COMM_LEN];
+ char data[REASON_LEN];
size_t datalen;
- size_t shutcomm_len;
+ size_t reason_len;
char *communication;
datalen = 0;
- communication = peer->conf.shutcomm;
+ communication = peer->conf.reason;
if ((subcode == ERR_CEASE_ADMIN_DOWN ||
subcode == ERR_CEASE_ADMIN_RESET)
&& communication && *communication) {
- shutcomm_len = strlen(communication);
- if (shutcomm_len > SHUT_COMM_LEN - 1) {
+ reason_len = strlen(communication);
+ if (reason_len > REASON_LEN - 1) {
log_peer_warnx(&peer->conf,
"trying to send overly long shutdown reason");
} else {
- data[0] = shutcomm_len;
- datalen = shutcomm_len + sizeof(data[0]);
- memcpy(data + 1, communication, shutcomm_len);
+ data[0] = reason_len;
+ datalen = reason_len + sizeof(data[0]);
+ memcpy(data + 1, communication, reason_len);
}
}
switch (peer->state) {
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index 522e1c5f863..67c0e34a65f 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.145 2020/02/12 10:33:56 claudio Exp $ */
+/* $OpenBSD: session.h,v 1.146 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -174,7 +174,7 @@ struct peer_stats {
u_int8_t last_sent_suberr;
u_int8_t last_rcvd_errcode;
u_int8_t last_rcvd_suberr;
- char last_shutcomm[SHUT_COMM_LEN];
+ char last_reason[REASON_LEN];
};
enum Timer {
diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c
index 39480fe82ee..90315c8a92a 100644
--- a/usr.sbin/bgpd/util.c
+++ b/usr.sbin/bgpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.53 2020/04/23 16:13:11 claudio Exp $ */
+/* $OpenBSD: util.c,v 1.54 2020/05/10 13:38:46 deraadt Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -163,8 +163,8 @@ log_ext_subtype(short type, u_int8_t subtype)
}
const char *
-log_shutcomm(const char *communication) {
- static char buf[(SHUT_COMM_LEN - 1) * 4 + 1];
+log_reason(const char *communication) {
+ static char buf[(REASON_LEN - 1) * 4 + 1];
strnvis(buf, communication, sizeof(buf), VIS_NL | VIS_OCTAL);