aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/in_rmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/in_rmx.c')
-rw-r--r--sys/netinet/in_rmx.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index 38a9d9232a8a..21f2e67b15bd 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -54,10 +54,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_icmp.h>
#include <netinet/ip_var.h>
-extern int in_inithead(void **head, int off, u_int fibnum);
-#ifdef VIMAGE
-extern int in_detachhead(void **head, int off);
-#endif
static int
rib4_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *mask,
@@ -121,38 +117,32 @@ rib4_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *ma
return (0);
}
-static int _in_rt_was_here;
/*
* Initialize our routing tree.
*/
-int
-in_inithead(void **head, int off, u_int fibnum)
+struct rib_head *
+in_inithead(uint32_t fibnum)
{
struct rib_head *rh;
rh = rt_table_init(32, AF_INET, fibnum);
if (rh == NULL)
- return (0);
+ return (NULL);
rh->rnh_preadd = rib4_preadd;
#ifdef RADIX_MPATH
rt_mpath_init_rnh(rh);
#endif
- *head = (void *)rh;
- if (_in_rt_was_here == 0 ) {
- _in_rt_was_here = 1;
- }
- return 1;
+ return (rh);
}
#ifdef VIMAGE
-int
-in_detachhead(void **head, int off)
+void
+in_detachhead(struct rib_head *rh)
{
- rt_table_destroy((struct rib_head *)(*head));
- return (1);
+ rt_table_destroy(rh);
}
#endif