summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-08-14 16:25:22 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2012-08-14 16:46:43 +0200
commit094d2bdb79e1ffa0a02761fd651aa0f0b6b0c585 (patch)
treef7cb65c540403ed152677dde3b803c3dd117d8e5 /sysdep/unix
parentd760229ab897fa1bf1fd0fe7019cc2431d21a1cc (diff)
Implements ADD-PATH extension for BGP.
Allows to send and receive multiple routes for one network by one BGP session. Also contains necessary core changes to support this (routing tables accepting several routes for one network from one protocol). It needs some more cleanup before merging to the master branch.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 2bd1bc44..497d328d 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -340,15 +340,14 @@ krt_learn_announce_update(struct krt_proto *p, rte *e)
ee->pflags = 0;
ee->pref = p->p.preference;
ee->u.krt = e->u.krt;
- rte_update(p->p.table, nn, &p->p, &p->p, ee);
+ rte_update(&p->p, nn, ee);
}
static void
krt_learn_announce_delete(struct krt_proto *p, net *n)
{
n = net_find(p->p.table, n->n.prefix, n->n.pxlen);
- if (n)
- rte_update(p->p.table, n, &p->p, &p->p, NULL);
+ rte_update(&p->p, n, NULL);
}
/* Called when alien route is discovered during scan */
@@ -692,7 +691,7 @@ krt_export_rte(struct krt_proto *p, rte **new, ea_list **tmpa)
if (filter == FILTER_ACCEPT)
return 1;
- struct proto *src = (*new)->attrs->proto;
+ struct proto *src = (*new)->attrs->src->proto;
*tmpa = src->make_tmp_attrs ? src->make_tmp_attrs(*new, krt_filter_lp) : NULL;
return f_run(filter, new, tmpa, krt_filter_lp, FF_FORCE_TMPATTR) <= F_ACCEPT;
}
@@ -874,7 +873,7 @@ krt_import_control(struct proto *P, rte **new, ea_list **attrs, struct linpool *
struct krt_proto *p = (struct krt_proto *) P;
rte *e = *new;
- if (e->attrs->proto == P)
+ if (e->attrs->src->proto == P)
return -1;
if (!KRT_CF->devroutes &&
@@ -926,10 +925,10 @@ krt_init(struct proto_config *c)
struct krt_proto *p = proto_new(c, sizeof(struct krt_proto));
p->p.accept_ra_types = RA_OPTIMAL;
- p->p.make_tmp_attrs = krt_make_tmp_attrs;
- p->p.store_tmp_attrs = krt_store_tmp_attrs;
p->p.import_control = krt_import_control;
p->p.rt_notify = krt_notify;
+ p->p.make_tmp_attrs = krt_make_tmp_attrs;
+ p->p.store_tmp_attrs = krt_store_tmp_attrs;
p->p.rte_same = krt_rte_same;
krt_sys_init(p);