summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-01-13 13:18:04 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-01-13 13:18:04 +0000
commite35dbdf6a9608250412b7815760889f6f2239f24 (patch)
tree52460368ec17ecbb243c8404bd58480189c996d6 /usr.sbin/bgpd/rde.c
parentea1f8410feedad905d718155ed79b6201d3591f0 (diff)
Dump and send RIB to the neighbor if his session is comming up.
Now bgpctl neighbor <IP> up does work as expected. Looks good from henning@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 75152aec191..f79709b9058 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.60 2004/01/11 22:08:04 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.61 2004/01/13 13:18:03 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -627,6 +627,24 @@ rde_send_nexthop(struct bgpd_addr *next, int valid)
*/
u_char queue_buf[4096];
+void
+rde_generate_updates(struct prefix *new, struct prefix *old)
+{
+ struct rde_peer *peer;
+
+ if ((old == NULL || old->aspath->nexthop == NULL ||
+ old->aspath->nexthop->state != NEXTHOP_REACH) &&
+ (new == NULL || new->aspath->nexthop == NULL ||
+ new->aspath->nexthop->state != NEXTHOP_REACH))
+ return;
+
+ LIST_FOREACH(peer, &peerlist, peer_l) {
+ if (peer->state != PEER_UP)
+ continue;
+ up_generate_updates(peer, new, old);
+ }
+}
+
u_int16_t
rde_local_as(void)
{
@@ -796,6 +814,7 @@ peer_up(u_int32_t id, struct session_up *sup)
sizeof(peer->remote_addr));
peer->state = PEER_UP;
up_init(peer);
+ pt_dump(up_dump_upcall, peer);
}
void