summaryrefslogtreecommitdiff
path: root/proto/static
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/static
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/static')
-rw-r--r--proto/static/static.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/static/static.c b/proto/static/static.c
index 6a027f50..b6c8948f 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -67,7 +67,7 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa)
DBG("Installing static route %I/%d, rtd=%d\n", r->net, r->masklen, r->dest);
bzero(&a, sizeof(a));
- a.proto = p;
+ a.src = p->main_source;
a.source = (r->dest == RTD_DEVICE) ? RTS_STATIC_DEVICE : RTS_STATIC;
a.scope = SCOPE_UNIVERSE;
a.cast = RTC_UNICAST;
@@ -113,7 +113,7 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa)
e = rte_get_temp(aa);
e->net = n;
e->pflags = 0;
- rte_update(p->table, n, p, p, e);
+ rte_update(p, n, e);
r->installed = 1;
}
@@ -127,8 +127,7 @@ static_remove(struct proto *p, struct static_route *r)
DBG("Removing static route %I/%d\n", r->net, r->masklen);
n = net_find(p->table, r->net, r->masklen);
- if (n)
- rte_update(p->table, n, p, p, NULL);
+ rte_update(p, n, NULL);
r->installed = 0;
}
@@ -367,6 +366,7 @@ static_init(struct proto_config *c)
p->neigh_notify = static_neigh_notify;
p->if_notify = static_if_notify;
+
return p;
}