summaryrefslogtreecommitdiff
path: root/sys/net/radix.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-06-28 18:50:38 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-06-28 18:50:38 +0000
commit22b0156759c053e251b29ef230ddf75b9e45d9f4 (patch)
tree58fbb22339399962bcb296ceb830e2d267c226a7 /sys/net/radix.c
parentf668ba96c8a5c3248f9ce4db53f92c7ef8e16f9c (diff)
Add the rtable id as an argument to rn_walktree(). Functions like
rt_if_remove_rtdelete() need to know the table id to be able to correctly remove nodes. Problem found by Andrea Parazzini and analyzed by Martin Pelikán. OK henning@
Diffstat (limited to 'sys/net/radix.c')
-rw-r--r--sys/net/radix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/radix.c b/sys/net/radix.c
index dd6e6a8748f..9ee6c10dd06 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radix.c,v 1.26 2009/01/06 21:40:47 claudio Exp $ */
+/* $OpenBSD: radix.c,v 1.27 2010/06/28 18:50:37 claudio Exp $ */
/* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */
/*
@@ -950,8 +950,8 @@ out:
}
int
-rn_walktree(struct radix_node_head *h, int (*f)(struct radix_node *, void *),
- void *w)
+rn_walktree(struct radix_node_head *h, int (*f)(struct radix_node *, void *,
+ u_int), void *w)
{
int error;
struct radix_node *base, *next;
@@ -976,7 +976,8 @@ rn_walktree(struct radix_node_head *h, int (*f)(struct radix_node *, void *),
/* Process leaves */
while ((rn = base) != NULL) {
base = rn->rn_dupedkey;
- if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w)))
+ if (!(rn->rn_flags & RNF_ROOT) &&
+ (error = (*f)(rn, w, h->rnh_rtabelid)))
return (error);
}
rn = next;