diff options
Diffstat (limited to 'proto/pipe')
-rw-r--r-- | proto/pipe/Makefile | 3 | ||||
-rw-r--r-- | proto/pipe/pipe.c | 36 |
2 files changed, 21 insertions, 18 deletions
diff --git a/proto/pipe/Makefile b/proto/pipe/Makefile index 5093da98..ba66027f 100644 --- a/proto/pipe/Makefile +++ b/proto/pipe/Makefile @@ -2,5 +2,6 @@ src := pipe.c obj := $(src-o-files) $(all-daemon) $(cf-local) +$(call proto-build,pipe_build) -tests_objs := $(tests_objs) $(src-o-files)
\ No newline at end of file +tests_objs := $(tests_objs) $(src-o-files) diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index 481f5804..1f1ad857 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -43,6 +43,10 @@ #include "pipe.h" +#ifdef CONFIG_BGP +#include "proto/bgp/bgp.h" +#endif + static void pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *old) { @@ -65,34 +69,26 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o if (new) { + src = new->src; + a = alloca(rta_size(new->attrs)); memcpy(a, new->attrs, rta_size(new->attrs)); - a->aflags = 0; + a->cached = 0; a->hostentry = NULL; - e = rte_get_temp(a); - e->pflags = 0; - - /* Copy protocol specific embedded attributes. */ - memcpy(&(e->u), &(new->u), sizeof(e->u)); - e->pref = new->pref; + e = rte_get_temp(a, src); e->pflags = new->pflags; #ifdef CONFIG_BGP /* Hack to cleanup cached value */ - if (e->attrs->src->proto->proto == &proto_bgp) - { - e->u.bgp.stale = -1; - e->u.bgp.base_table = NULL; - } + if (e->src->proto->proto == &proto_bgp) + e->pflags &= ~(BGP_REF_STALE | BGP_REF_NOT_STALE); #endif - - src = a->src; } else { e = NULL; - src = old->attrs->src; + src = old->src; } src_ch->table->pipe_busy = 1; @@ -101,9 +97,9 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o } static int -pipe_preexport(struct channel *C, rte **ee, struct linpool *p UNUSED) +pipe_preexport(struct channel *C, rte *e) { - struct proto *pp = (*ee)->sender->proto; + struct proto *pp = e->sender->proto; if (pp == C->proto) return -1; /* Avoid local loops automatically */ @@ -307,3 +303,9 @@ struct protocol proto_pipe = { .get_status = pipe_get_status, .show_proto_info = pipe_show_proto_info }; + +void +pipe_build(void) +{ + proto_build(&proto_pipe); +} |