summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-07-30 09:45:53 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-07-30 09:45:53 +0000
commitd609d885334456ed6d80edef48411d8056b9122d (patch)
treece1af81305e22deb7c36ab4445035af9134c3764 /usr.sbin
parenta535c300709b5e5d7f652a9c3236fc8f19aef32a (diff)
Fix the show rib detail output. The add_path condition was totally wrong.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpctl/output.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c
index 6d2f8461e39..22c7dcce26b 100644
--- a/usr.sbin/bgpctl/output.c
+++ b/usr.sbin/bgpctl/output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: output.c,v 1.18 2021/07/27 07:42:37 claudio Exp $ */
+/* $OpenBSD: output.c,v 1.19 2021/07/30 09:45:52 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -948,14 +948,14 @@ show_rib_detail(struct ctl_show_rib *r, u_char *asdata, size_t aslen,
free(aspath);
s = fmt_peer(r->descr, &r->remote_addr, -1);
- printf(" Nexthop %s ", log_addr(&r->exit_nexthop));
- printf("(via %s) Neighbor %s (", log_addr(&r->true_nexthop), s);
- free(s);
id.s_addr = htonl(r->remote_id);
-
+ printf(" Nexthop %s ", log_addr(&r->exit_nexthop));
+ printf("(via %s) Neighbor %s (%s)", log_addr(&r->true_nexthop), s,
+ inet_ntoa(id));
if (r->flags & F_PREF_PATH_ID)
- printf("%s) Path-Id: %u%c", inet_ntoa(id), r->path_id,
- EOL0(flag0));
+ printf(" Path-Id: %u", r->path_id);
+ printf("%c", EOL0(flag0));
+ free(s);
printf(" Origin %s, metric %u, localpref %u, weight %u, ovs %s, ",
fmt_origin(r->origin, 0), r->med, r->local_pref, r->weight,