summaryrefslogtreecommitdiff
path: root/proto/rip
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-04-08 13:08:03 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-04-08 13:09:06 +0200
commit2003a1840731bd57365876e48c96c5a1ea0348cb (patch)
treec473a93f4027ea2706ccac3502ccef36736fbb6d /proto/rip
parent4bdf1881dc6230b742d7efcaad8eeac4ed25f445 (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/rip')
-rw-r--r--proto/rip/rip.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 22023279..131c09ce 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -143,8 +143,6 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
if (rt)
{
/* Update */
- net *n = net_get(p->p.main_channel->table, en->n.addr);
-
rta a0 = {
.src = p->p.main_source,
.source = RTS_RIP,
@@ -204,16 +202,14 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
e->u.rip.metric = rt_metric;
e->u.rip.tag = rt_tag;
- e->net = n;
e->pflags = 0;
- rte_update(&p->p, n, e);
+ rte_update(&p->p, en->n.addr, e);
}
else
{
/* Withdraw */
- net *n = net_find(p->p.main_channel->table, en->n.addr);
- rte_update(&p->p, n, NULL);
+ rte_update(&p->p, en->n.addr, NULL);
}
}