diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-08-14 16:25:22 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-08-14 16:46:43 +0200 |
commit | 094d2bdb79e1ffa0a02761fd651aa0f0b6b0c585 (patch) | |
tree | f7cb65c540403ed152677dde3b803c3dd117d8e5 /nest/rt-dev.c | |
parent | d760229ab897fa1bf1fd0fe7019cc2431d21a1cc (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 'nest/rt-dev.c')
-rw-r--r-- | nest/rt-dev.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/nest/rt-dev.c b/nest/rt-dev.c index 54cb14ba..7319018f 100644 --- a/nest/rt-dev.c +++ b/nest/rt-dev.c @@ -48,29 +48,31 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad) DBG("dev_if_notify: device shutdown: prefix not found\n"); return; } - rte_update(p->table, n, p, p, NULL); + rte_update(p, n, NULL); } else if (c & IF_CHANGE_UP) { - rta *a, A; + rta *a; net *n; rte *e; DBG("dev_if_notify: %s:%I going up\n", ad->iface->name, ad->ip); - bzero(&A, sizeof(A)); - A.proto = p; - A.source = RTS_DEVICE; - A.scope = SCOPE_UNIVERSE; - A.cast = RTC_UNICAST; - A.dest = RTD_DEVICE; - A.iface = ad->iface; - A.eattrs = NULL; - a = rta_lookup(&A); + + rta a0 = { + .src = p->main_source, + .source = RTS_DEVICE, + .scope = SCOPE_UNIVERSE, + .cast = RTC_UNICAST, + .dest = RTD_DEVICE, + .iface = ad->iface + }; + + a = rta_lookup(&a0); n = net_get(p->table, ad->prefix, ad->pxlen); e = rte_get_temp(a); e->net = n; e->pflags = 0; - rte_update(p->table, n, p, p, e); + rte_update(p, n, e); } } |