diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-05-31 15:24:27 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-05-31 15:24:27 +0200 |
commit | 23ac9e9a9eefe13918ee7f21a1d0f271a44d9efd (patch) | |
tree | 8216b9e5755798e342bf7a81dff03bc666ee97d9 /proto | |
parent | 23e563d86b412632644bdc4a886b0b7fb60e5175 (diff) |
Changes pipes to transfer all routes between routing table, not just optimal routes.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/bgp/bgp.c | 1 | ||||
-rw-r--r-- | proto/ospf/ospf.c | 1 | ||||
-rw-r--r-- | proto/pipe/pipe.c | 25 | ||||
-rw-r--r-- | proto/rip/rip.c | 1 |
4 files changed, 22 insertions, 6 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index cbc699bb..b42ea302 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -753,6 +753,7 @@ bgp_init(struct proto_config *C) struct proto *P = proto_new(C, sizeof(struct bgp_proto)); struct bgp_proto *p = (struct bgp_proto *) P; + P->accept_ra_types = RA_OPTIMAL; P->rt_notify = bgp_rt_notify; P->rte_better = bgp_rte_better; P->import_control = bgp_import_control; diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 0cab1d7b..69d37241 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -224,6 +224,7 @@ ospf_init(struct proto_config *c) p->import_control = ospf_import_control; p->make_tmp_attrs = ospf_make_tmp_attrs; p->store_tmp_attrs = ospf_store_tmp_attrs; + p->accept_ra_types = RA_OPTIMAL; p->rt_notify = ospf_rt_notify; p->if_notify = ospf_iface_notify; p->rte_better = ospf_rte_better; diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index d1d6bba9..0240d16e 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -31,12 +31,16 @@ #include "pipe.h" static void -pipe_send(struct pipe_proto *p, rtable *dest, net *n, rte *new, rte *old UNUSED, ea_list *attrs) +pipe_send(struct pipe_proto *p, rtable *dest, net *n, rte *new, rte *old, ea_list *attrs) { + struct proto *src; net *nn; rte *e; rta a; + if (!new && !old) + return; + if (dest->pipe_busy) { log(L_ERR "Pipe loop detected when sending %I/%d to table %s", @@ -47,17 +51,24 @@ pipe_send(struct pipe_proto *p, rtable *dest, net *n, rte *new, rte *old UNUSED, if (new) { memcpy(&a, new->attrs, sizeof(rta)); - a.proto = &p->p; - a.source = RTS_PIPE; a.aflags = 0; a.eattrs = attrs; e = rte_get_temp(&a); e->net = nn; + + /* Copy protocol specific embedded attributes. */ + memcpy(&(e->u), &(new->u), sizeof(e->u)); + + src = new->attrs->proto; } else - e = NULL; + { + e = NULL; + src = old->attrs->proto; + } + dest->pipe_busy = 1; - rte_update(dest, nn, &p->p, e); + rte_update2(dest, nn, &p->p, src, e); dest->pipe_busy = 0; } @@ -82,7 +93,7 @@ pipe_rt_notify_sec(struct proto *P, net *net, rte *new, rte *old, ea_list *attrs static int pipe_import_control(struct proto *P, rte **ee, ea_list **ea UNUSED, struct linpool *p UNUSED) { - struct proto *pp = (*ee)->attrs->proto; + struct proto *pp = (*ee)->sender; if (pp == P || pp == &((struct pipe_proto *) P)->phantom->p) return -1; /* Avoid local loops automatically */ @@ -106,6 +117,7 @@ pipe_start(struct proto *P) memcpy(ph, p, sizeof(struct pipe_proto)); p->phantom = ph; ph->phantom = p; + ph->p.accept_ra_types = RA_ANY; ph->p.rt_notify = pipe_rt_notify_sec; ph->p.proto_state = PS_UP; ph->p.core_state = ph->p.core_goal = FS_HAPPY; @@ -141,6 +153,7 @@ pipe_init(struct proto_config *C) struct pipe_proto *p = (struct pipe_proto *) P; p->peer = c->peer->table; + P->accept_ra_types = RA_ANY; P->rt_notify = pipe_rt_notify_pri; P->import_control = pipe_import_control; return P; diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 12cc8783..ab417f01 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -946,6 +946,7 @@ rip_rte_remove(net *net UNUSED, rte *rte) void rip_init_instance(struct proto *p) { + p->accept_ra_types = RA_OPTIMAL; p->if_notify = rip_if_notify; p->rt_notify = rip_rt_notify; p->import_control = rip_import_control; |