sync with OpenBSD -current

This commit is contained in:
purplerain 2024-05-23 16:36:12 +00:00
parent 12fde4069b
commit c1d0febac8
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
149 changed files with 556 additions and 649 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: bgpctl.c,v 1.305 2024/02/01 11:37:10 claudio Exp $ */
/* $OpenBSD: bgpctl.c,v 1.306 2024/05/22 08:42:34 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@ -1548,15 +1548,16 @@ show_mrt_capabilities(struct ibuf *b)
static void
show_mrt_open(struct ibuf *b)
{
struct in_addr ina;
uint32_t bgpid;
uint16_t short_as, holdtime;
uint8_t version, optparamlen;
struct in_addr bgpid;
/* length check up to optparamlen already happened */
if (ibuf_get_n8(b, &version) == -1 ||
ibuf_get_n16(b, &short_as) == -1 ||
ibuf_get_n16(b, &holdtime) == -1 ||
ibuf_get(b, &bgpid, sizeof(bgpid)) == -1 ||
ibuf_get_n32(b, &bgpid) == -1 ||
ibuf_get_n8(b, &optparamlen) == -1) {
trunc:
printf("truncated message");
@ -1564,8 +1565,9 @@ show_mrt_open(struct ibuf *b)
}
printf("\n ");
ina.s_addr = htonl(bgpid);
printf("Version: %d AS: %u Holdtime: %u BGP Id: %s Paramlen: %u",
version, short_as, holdtime, inet_ntoa(bgpid), optparamlen);
version, short_as, holdtime, inet_ntoa(ina), optparamlen);
if (optparamlen != ibuf_size(b)) {
/* XXX missing support for RFC9072 */
printf("optional parameter length mismatch");

View file

@ -1,4 +1,4 @@
/* $OpenBSD: output.c,v 1.50 2024/01/31 11:23:20 claudio Exp $ */
/* $OpenBSD: output.c,v 1.51 2024/05/22 08:42:34 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@ -299,7 +299,7 @@ show_neighbor_full(struct peer *p, struct parse_result *res)
printf("\n");
if (p->state == STATE_ESTABLISHED) {
ina.s_addr = p->remote_bgpid;
ina.s_addr = htonl(p->remote_bgpid);
printf(" BGP version 4, remote router-id %s",
inet_ntoa(ina));
printf("%s\n", fmt_auth_method(p->auth.method));

View file

@ -1,4 +1,4 @@
/* $OpenBSD: output_json.c,v 1.43 2024/04/24 10:42:09 claudio Exp $ */
/* $OpenBSD: output_json.c,v 1.44 2024/05/22 08:42:34 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@ -324,7 +324,7 @@ json_neighbor(struct peer *p, struct parse_result *res)
log_addr(&p->conf.remote_addr), p->conf.remote_masklen);
if (p->state == STATE_ESTABLISHED) {
struct in_addr ina;
ina.s_addr = p->remote_bgpid;
ina.s_addr = htonl(p->remote_bgpid);
json_do_string("bgpid", inet_ntoa(ina));
}
json_do_string("state", statenames[p->state]);