summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-06-14 17:08:57 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-06-14 17:08:57 +0000
commit5557950a35f921083f934651de5938568b91bdc0 (patch)
tree369f58026537e6650c917a49cc5e6ab4d2e34c77 /usr.sbin/bgpd/rde.c
parent9bd6c0718d0412569b861658965b1ffd3896d9e3 (diff)
Send bot nexthops (exit and true) in the bgpctl show rib cases. bgpctl
can than select which nexthop should be printed. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 0ae7ccf70b2..2d4db52c35d 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.206 2006/05/28 22:07:54 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.207 2006/06/14 17:08:56 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1527,13 +1527,17 @@ rde_dump_rib_as(struct prefix *p, pid_t pid, int all)
memcpy(&rib.remote_addr, &p->aspath->peer->remote_addr,
sizeof(rib.remote_addr));
rib.remote_id = p->aspath->peer->remote_bgpid;
- if (p->aspath->nexthop != NULL)
- memcpy(&rib.nexthop, &p->aspath->nexthop->true_nexthop,
- sizeof(rib.nexthop));
- else {
+ if (p->aspath->nexthop != NULL) {
+ memcpy(&rib.true_nexthop, &p->aspath->nexthop->true_nexthop,
+ sizeof(rib.true_nexthop));
+ memcpy(&rib.exit_nexthop, &p->aspath->nexthop->exit_nexthop,
+ sizeof(rib.exit_nexthop));
+ } else {
/* announced network may have a NULL nexthop */
- bzero(&rib.nexthop, sizeof(rib.nexthop));
- rib.nexthop.af = p->prefix->af;
+ bzero(&rib.true_nexthop, sizeof(rib.true_nexthop));
+ bzero(&rib.exit_nexthop, sizeof(rib.exit_nexthop));
+ rib.true_nexthop.af = p->prefix->af;
+ rib.exit_nexthop.af = p->prefix->af;
}
pt_getaddr(p->prefix, &rib.prefix);
rib.prefixlen = p->prefix->prefixlen;