summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/bgpctl.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-12-20 07:17:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-12-20 07:17:03 +0000
commit90f16743f4462fb3a7fafff847117bf3240eb56f (patch)
tree08748c9ebb8d78f55f4132b3af7afff135c7ddf7 /usr.sbin/bgpctl/bgpctl.c
parent256d381c1ee3707411f9a1851218627356581a1e (diff)
Change show_mrt_dump() to call show_rib() instead of the internal
show_rib_detail() and show_rib_brief() functions. OK benno@
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index d0ad1721937..6d0f5a21d43 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.251 2019/12/19 06:43:51 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.252 2019/12/20 07:17:02 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -1880,10 +1880,14 @@ void
show_mrt_dump(struct mrt_rib *mr, struct mrt_peer *mp, void *arg)
{
struct ctl_show_rib ctl;
+ struct parse_result res;
struct ctl_show_rib_request *req = arg;
struct mrt_rib_entry *mre;
u_int16_t i, j;
+ memset(&res, 0, sizeof(res));
+ res.flags = req->flags;
+
for (i = 0; i < mr->nentries; i++) {
mre = &mr->entries[i];
bzero(&ctl, sizeof(ctl));
@@ -1937,14 +1941,13 @@ show_mrt_dump(struct mrt_rib *mr, struct mrt_peer *mp, void *arg)
!match_aspath(mre->aspath, mre->aspath_len, &req->as))
continue;
+ show_rib(&ctl, mre->aspath, mre->aspath_len, &res);
if (req->flags & F_CTL_DETAIL) {
- show_rib_detail(&ctl, mre->aspath, mre->aspath_len, 0);
for (j = 0; j < mre->nattrs; j++)
show_attr(mre->attrs[j].attr,
mre->attrs[j].attr_len,
req->flags);
- } else
- show_rib_brief(&ctl, mre->aspath, mre->aspath_len);
+ }
}
}