From cfe34a316e35a209fcd814ccf3523c262e8d4b0a Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 5 Jul 2010 17:50:19 +0200 Subject: Implements hostcache and recursive next hops. Hostcache is a structure for monitoring changes in a routing table that is used for routes with dynamic/recursive next hops. This is needed for proper iBGP next hop handling. --- proto/pipe/pipe.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'proto/pipe/pipe.c') diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index 7fdf273..e557097 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -63,6 +63,7 @@ pipe_rt_notify(struct proto *P, rtable *src_table, net *n, rte *new, rte *old, e a.aflags = 0; a.eattrs = attrs; + a.hostentry = NULL; e = rte_get_temp(&a); e->net = nn; e->pflags = 0; @@ -120,7 +121,7 @@ pipe_start(struct proto *P) /* Clean up the secondary stats */ bzero(&p->peer_stats, sizeof(struct proto_stats)); - /* Lock the peer table, unlock is handled in proto_fell_down() */ + /* Lock the peer table, unlock is handled in pipe_cleanup() */ rt_lock_table(p->peer); /* Connect the protocol also to the peer routing table. */ @@ -129,6 +130,13 @@ pipe_start(struct proto *P) return PS_UP; } +static void +pipe_cleanup(struct proto *P) +{ + struct pipe_proto *p = (struct pipe_proto *) P; + rt_unlock_table(p->peer); +} + static struct proto * pipe_init(struct proto_config *C) { @@ -185,6 +193,7 @@ struct protocol proto_pipe = { postconfig: pipe_postconfig, init: pipe_init, start: pipe_start, + cleanup: pipe_cleanup, reconfigure: pipe_reconfigure, get_status: pipe_get_status, }; -- cgit v1.2.3