summaryrefslogtreecommitdiff
path: root/proto/ospf
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 /proto/ospf
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 'proto/ospf')
-rw-r--r--proto/ospf/ospf.c10
-rw-r--r--proto/ospf/rt.c8
2 files changed, 9 insertions, 9 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index aa62da14..1aa7407a 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -298,14 +298,14 @@ ospf_init(struct proto_config *c)
{
struct proto *p = proto_new(c, sizeof(struct proto_ospf));
- p->make_tmp_attrs = ospf_make_tmp_attrs;
- p->store_tmp_attrs = ospf_store_tmp_attrs;
- p->import_control = ospf_import_control;
- p->reload_routes = ospf_reload_routes;
p->accept_ra_types = RA_OPTIMAL;
p->rt_notify = ospf_rt_notify;
p->if_notify = ospf_if_notify;
p->ifa_notify = ospf_ifa_notify;
+ p->import_control = ospf_import_control;
+ p->reload_routes = ospf_reload_routes;
+ p->make_tmp_attrs = ospf_make_tmp_attrs;
+ p->store_tmp_attrs = ospf_store_tmp_attrs;
p->rte_better = ospf_rte_better;
p->rte_same = ospf_rte_same;
@@ -502,7 +502,7 @@ ospf_import_control(struct proto *p, rte ** new, ea_list ** attrs,
struct ospf_area *oa = ospf_main_area((struct proto_ospf *) p);
rte *e = *new;
- if (p == e->attrs->proto)
+ if (e->attrs->src->proto == p)
return -1; /* Reject our own routes */
if (oa_is_stub(oa))
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 4b8de4b8..1053fd07 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1987,10 +1987,10 @@ again1:
if (nf->n.type) /* Add the route */
{
rta a0 = {
- .proto = p,
+ .src = p->main_source,
.source = nf->n.type,
.scope = SCOPE_UNIVERSE,
- .cast = RTC_UNICAST,
+ .cast = RTC_UNICAST
};
if (nf->n.nhs->next)
@@ -2028,7 +2028,7 @@ again1:
DBG("Mod rte type %d - %I/%d via %I on iface %s, met %d\n",
a0.source, nf->fn.prefix, nf->fn.pxlen, a0.gw, a0.iface ? a0.iface->name : "(none)", nf->n.metric1);
- rte_update(p->table, ne, p, p, e);
+ rte_update(p, ne, e);
}
}
else if (nf->old_rta)
@@ -2038,7 +2038,7 @@ again1:
nf->old_rta = NULL;
net *ne = net_get(p->table, nf->fn.prefix, nf->fn.pxlen);
- rte_update(p->table, ne, p, p, NULL);
+ rte_update(p, ne, NULL);
}
/* Remove unused rt entry. Entries with fn.x0 == 1 are persistent. */