summaryrefslogtreecommitdiff
path: root/proto/rip/rip.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-21 20:16:05 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-21 20:28:44 +0100
commit600998fcb1a1d155215ab32644982e9b78767e3e (patch)
tree987193a992951f8a543d3473441202b6b26f0f08 /proto/rip/rip.c
parent67aa88336a91e635753ba42df45d7de5e191ed35 (diff)
Modify FIB_WALK() and FIB_ITERATE() to work with new FIB code
Returned user data pointers have offset relative to fib_node.
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r--proto/rip/rip.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index f90d7711..7e5d6802 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -823,9 +823,8 @@ rip_timer(timer *t)
FIB_ITERATE_INIT(&fit, &p->rtable);
loop:
- FIB_ITERATE_START(&p->rtable, &fit, node)
+ FIB_ITERATE_START(&p->rtable, &fit, struct rip_entry, en)
{
- struct rip_entry *en = (struct rip_entry *) node;
struct rip_rte *rt, **rp;
int changed = 0;
@@ -852,7 +851,7 @@ rip_timer(timer *t)
* rip_rt_notify() -> p->rtable change, invalidating hidden variables.
*/
- FIB_ITERATE_PUT_NEXT(&fit, &p->rtable, node);
+ FIB_ITERATE_PUT_NEXT(&fit, &p->rtable);
rip_announce_rte(p, en);
goto loop;
}
@@ -874,12 +873,12 @@ rip_timer(timer *t)
/* Remove empty nodes */
if (!en->valid && !en->routes)
{
- FIB_ITERATE_PUT(&fit, node);
- fib_delete(&p->rtable, node);
+ FIB_ITERATE_PUT(&fit);
+ fib_delete(&p->rtable, en);
goto loop;
}
}
- FIB_ITERATE_END(node);
+ FIB_ITERATE_END;
p->rt_reload = 0;
@@ -1248,9 +1247,8 @@ rip_dump(struct proto *P)
int i;
i = 0;
- FIB_WALK(&p->rtable, e)
+ FIB_WALK(&p->rtable, struct rip_entry, en)
{
- struct rip_entry *en = (struct rip_entry *) e;
debug("RIP: entry #%d: %N via %I dev %s valid %d metric %d age %d s\n",
i++, en->n.addr, en->next_hop, en->iface->name,
en->valid, en->metric, now - en->changed);