summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-12-19 10:32:21 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-12-19 10:32:21 +0000
commit2bddb31939d3f508ac689ed351fe44352b594b7f (patch)
tree9d13189de03e67ef11e5ff406ed259b0b5d5840f /usr.sbin/bgpctl
parentc764ee708110d5400f7e46f00cce7a273ea76ff5 (diff)
Show the RTR protocol version in the `bgpctl show rtr` output.
Knowing the version is essential to understand if ASPA PDUs are included or not. OK tb@
Diffstat (limited to 'usr.sbin/bgpctl')
-rw-r--r--usr.sbin/bgpctl/output.c6
-rw-r--r--usr.sbin/bgpctl/output_json.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c
index d9a5e52793c..9c8ba257d02 100644
--- a/usr.sbin/bgpctl/output.c
+++ b/usr.sbin/bgpctl/output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: output.c,v 1.42 2023/11/20 14:18:21 claudio Exp $ */
+/* $OpenBSD: output.c,v 1.43 2023/12/19 10:32:20 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -1176,8 +1176,8 @@ show_rtr(struct ctl_show_rtr *rtr)
if (rtr->local_addr.aid != AID_UNSPEC)
printf(" Local Address: %s\n", log_addr(&rtr->local_addr));
if (rtr->session_id != -1)
- printf(" Session ID: %d Serial #: %u\n",
- rtr->session_id, rtr->serial);
+ printf("Version: %u Session ID: %d Serial #: %u\n",
+ rtr->version, rtr->session_id, rtr->serial);
printf(" Refresh: %u, Retry: %u, Expire: %u\n",
rtr->refresh, rtr->retry, rtr->expire);
diff --git a/usr.sbin/bgpctl/output_json.c b/usr.sbin/bgpctl/output_json.c
index cf0a476fe0b..eb049b09e5b 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.36 2023/11/20 14:18:21 claudio Exp $ */
+/* $OpenBSD: output_json.c,v 1.37 2023/12/19 10:32:20 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@@ -1009,6 +1009,7 @@ json_rtr(struct ctl_show_rtr *rtr)
json_do_string("local_addr", log_addr(&rtr->local_addr));
if (rtr->session_id != -1) {
+ json_do_uint("version", rtr->version);
json_do_uint("session_id", rtr->session_id);
json_do_uint("serial", rtr->serial);
}