diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2016-04-08 13:08:03 +0200 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2016-04-08 13:09:06 +0200 |
commit | 2003a1840731bd57365876e48c96c5a1ea0348cb (patch) | |
tree | c473a93f4027ea2706ccac3502ccef36736fbb6d /proto/ospf/rt.c | |
parent | 4bdf1881dc6230b742d7efcaad8eeac4ed25f445 (diff) |
Route update: move table lookup from protocols into rte_update2().
Many protocols do almost the same when creating a rte_update request
before calling rte_update2(). This commit should simplify the protocol
side of the route-creation routine.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r-- | proto/ospf/rt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 0855f21f..5538f4c8 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -1973,7 +1973,6 @@ again1: if (reload || ort_changed(nf, &a0)) { - net *ne = net_get(p->p.main_channel->table, nf->fn.addr); rta *a = rta_lookup(&a0); rte *e = rte_get_temp(a); @@ -1984,11 +1983,10 @@ again1: e->u.ospf.tag = nf->old_tag = nf->n.tag; e->u.ospf.router_id = nf->old_rid = nf->n.rid; e->pflags = 0; - e->net = ne; DBG("Mod rte type %d - %N via %I on iface %s, met %d\n", a0.source, nf->fn.addr, a0.gw, a0.iface ? a0.iface->name : "(none)", nf->n.metric1); - rte_update(&p->p, ne, e); + rte_update(&p->p, nf->fn.addr, e); } } else if (nf->old_rta) @@ -1997,8 +1995,7 @@ again1: rta_free(nf->old_rta); nf->old_rta = NULL; - net *ne = net_get(p->p.main_channel->table, nf->fn.addr); - rte_update(&p->p, ne, NULL); + rte_update(&p->p, nf->fn.addr, NULL); } /* Remove unused rt entry, some special entries are persistent */ |