diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2010-03-06 21:27:26 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2010-03-06 21:27:26 +0000 |
commit | 1bb635b04d256e0a2d78454dd1815486e317f42f (patch) | |
tree | 888b29b7ba9788f9cc675c5b8d933d278f6db978 /sys/net | |
parent | 391dab1c2d4d3fdf8ffb14c5e8644a0f4cc08e11 (diff) | |
download | src-1bb635b04d256e0a2d78454dd1815486e317f42f.tar.gz src-1bb635b04d256e0a2d78454dd1815486e317f42f.zip |
Introduce a function rn_detachhead() that will free the
radix table root nodes. This is only needed (and available)
in the virtualization case to free the resources when tearing
down a virtual network stack.
Sponsored by: ISPsystem
Reviewed by: julian, zec
MFC after: 5 days
Notes
Notes:
svn path=/head/; revision=204808
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/radix.c | 18 | ||||
-rw-r--r-- | sys/net/radix.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sys/net/radix.c b/sys/net/radix.c index db1a46ce9035..24650e778aab 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -1161,6 +1161,24 @@ rn_inithead(head, off) return (1); } +#ifdef VIMAGE +int +rn_detachhead(void **head) +{ + struct radix_node_head *rnh; + + KASSERT((head != NULL && *head != NULL), + ("%s: head already freed", __func__)); + rnh = *head; + + /* Free <left,root,right> nodes. */ + Free(rnh); + + *head = NULL; + return (1); +} +#endif + void rn_init(int maxk) { diff --git a/sys/net/radix.h b/sys/net/radix.h index aa341b6caead..e8bbe257864a 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -162,6 +162,9 @@ struct radix_node_head { void rn_init(int); int rn_inithead(void **, int); +#ifdef VIMAGE +int rn_detachhead(void **); +#endif int rn_refines(void *, void *); struct radix_node *rn_addmask(void *, int, int), |