From e35dbdf6a9608250412b7815760889f6f2239f24 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 13 Jan 2004 13:18:04 +0000 Subject: Dump and send RIB to the neighbor if his session is comming up. Now bgpctl neighbor up does work as expected. Looks good from henning@ --- usr.sbin/bgpd/rde.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bgpd/rde.c') 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 @@ -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 -- cgit v1.2.3