summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/bgpd.h5
-rw-r--r--usr.sbin/bgpd/rde.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index c6d8e566d8d..3cff62feb6e 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.201 2006/05/27 21:24:36 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.202 2006/06/14 17:08:56 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -469,7 +469,8 @@ struct kroute6_label {
#define F_RIB_ANNOUNCE 0x08
struct ctl_show_rib {
- struct bgpd_addr nexthop;
+ struct bgpd_addr true_nexthop;
+ struct bgpd_addr exit_nexthop;
struct bgpd_addr prefix;
struct bgpd_addr remote_addr;
char descr[PEER_DESCR_LEN];
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;