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 /sysdep/unix | |
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 'sysdep/unix')
-rw-r--r-- | sysdep/unix/krt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index 6b3b4eee..fe8af1c0 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -345,18 +345,15 @@ krt_learn_announce_update(struct krt_proto *p, rte *e) net *n = e->net; rta *aa = rta_clone(e->attrs); rte *ee = rte_get_temp(aa); - net *nn = net_get(p->p.main_channel->table, n->n.addr); - ee->net = nn; ee->pflags = 0; ee->u.krt = e->u.krt; - rte_update(&p->p, nn, ee); + rte_update(&p->p, n->n.addr, ee); } static void krt_learn_announce_delete(struct krt_proto *p, net *n) { - n = net_find(p->p.main_channel->table, n->n.addr); - rte_update(&p->p, n, NULL); + rte_update(&p->p, n->n.addr, NULL); } /* Called when alien route is discovered during scan */ |