diff options
| author | Marko Zec <zec@FreeBSD.org> | 2009-06-08 17:15:40 +0000 |
|---|---|---|
| committer | Marko Zec <zec@FreeBSD.org> | 2009-06-08 17:15:40 +0000 |
| commit | bc29160df3d0b3a65d9b85a63a4589f1f9652e6b (patch) | |
| tree | 7c00057a3f90cc6cfd121e2a6594d254fc72cba3 /sys/netinet6 | |
| parent | 389cff511328e788e1a71dbb78154dd7d21b5fcc (diff) | |
Notes
Diffstat (limited to 'sys/netinet6')
| -rw-r--r-- | sys/netinet6/in6_proto.c | 9 | ||||
| -rw-r--r-- | sys/netinet6/in6_rmx.c | 15 | ||||
| -rw-r--r-- | sys/netinet6/ip6_input.c | 11 | ||||
| -rw-r--r-- | sys/netinet6/ip6_var.h | 3 | ||||
| -rw-r--r-- | sys/netinet6/ip6protosw.h | 2 | ||||
| -rw-r--r-- | sys/netinet6/nd6.c | 19 | ||||
| -rw-r--r-- | sys/netinet6/nd6.h | 3 |
7 files changed, 55 insertions, 7 deletions
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index c0b0b25da46f..e4d280dff241 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -148,6 +148,9 @@ struct ip6protosw inet6sw[] = { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, +#ifdef VIMAGE + .pr_destroy = ip6_destroy, +#endif .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, .pr_usrreqs = &nousrreqs, @@ -349,6 +352,9 @@ struct ip6protosw inet6sw[] = { }; extern int in6_inithead(void **, int); +#ifdef VIMAGE +extern int in6_detachhead(void **, int); +#endif struct domain inet6domain = { .dom_family = AF_INET6, @@ -361,6 +367,9 @@ struct domain inet6domain = { #else .dom_rtattach = in6_inithead, #endif +#ifdef VIMAGE + .dom_rtdetach = in6_detachhead, +#endif .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index 3a423ed0ff2d..4dbdad6e4b3e 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -112,6 +112,9 @@ __FBSDID("$FreeBSD$"); #include <netinet/tcp_var.h> extern int in6_inithead(void **head, int off); +#ifdef VIMAGE +extern int in6_detachhead(void **head, int off); +#endif #define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ @@ -464,3 +467,15 @@ in6_inithead(void **head, int off) in6_mtutimo(curvnet); /* kick off timeout first time */ return 1; } + +#ifdef VIMAGE +int +in6_detachhead(void **head, int off) +{ + INIT_VNET_INET6(curvnet); + + callout_drain(&V_rtq_timer6); + callout_drain(&V_rtq_mtutimer); + return (1); +} +#endif diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index b9617bb835d6..5166eb4cf3e9 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -303,6 +303,17 @@ ip6_init(void) netisr_register(&ip6_nh); } +#ifdef VIMAGE +void +ip6_destroy() +{ + INIT_VNET_INET6(curvnet); + + nd6_destroy(); + callout_drain(&V_in6_tmpaddrtimer_ch); +} +#endif + static int ip6_init2_vnet(const void *unused __unused) { diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 313b6caf372e..74749f65838f 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -339,6 +339,9 @@ int icmp6_ctloutput __P((struct socket *, struct sockopt *sopt)); struct in6_ifaddr; void ip6_init __P((void)); +#ifdef VIMAGE +void ip6_destroy __P((void)); +#endif void ip6_input __P((struct mbuf *)); struct in6_ifaddr *ip6_getdstifaddr __P((struct mbuf *)); void ip6_freepcbopts __P((struct ip6_pktopts *)); diff --git a/sys/netinet6/ip6protosw.h b/sys/netinet6/ip6protosw.h index 2a7cea404add..1fae44c8602a 100644 --- a/sys/netinet6/ip6protosw.h +++ b/sys/netinet6/ip6protosw.h @@ -129,6 +129,8 @@ struct ip6protosw { /* utility hooks */ void (*pr_init) /* initialization hook */ __P((void)); + void (*pr_destroy) /* cleanup hook */ + __P((void)); void (*pr_fasttimo) /* fast timeout (200ms) */ __P((void)); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index ccfdb8fc0791..96c6d018d39f 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -134,14 +134,8 @@ void nd6_init(void) { INIT_VNET_INET6(curvnet); - static int nd6_init_done = 0; int i; - if (nd6_init_done) { - log(LOG_NOTICE, "nd6_init called more than once(ignored)\n"); - return; - } - V_nd6_prune = 1; /* walk list every 1 seconds */ V_nd6_delay = 5; /* delay first probe time 5 second */ V_nd6_umaxtries = 3; /* maximum unicast query */ @@ -180,6 +174,8 @@ nd6_init(void) V_ip6_temp_valid_lifetime = DEF_TEMP_VALID_LIFETIME; V_ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE; + V_ip6_desync_factor = 0; + all1_sa.sin6_family = AF_INET6; all1_sa.sin6_len = sizeof(struct sockaddr_in6); for (i = 0; i < sizeof(all1_sa.sin6_addr); i++) @@ -191,10 +187,19 @@ nd6_init(void) callout_init(&V_nd6_slowtimo_ch, 0); callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); +} - nd6_init_done = 1; +#ifdef VIMAGE +void +nd6_destroy() +{ + INIT_VNET_INET6(curvnet); + + callout_drain(&V_nd6_slowtimo_ch); + callout_drain(&V_nd6_timer_ch); } +#endif struct nd_ifinfo * nd6_ifattach(struct ifnet *ifp) diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index d4d2fd577782..0730d8406d4f 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -371,6 +371,9 @@ union nd_opts { /* XXX: need nd6_var.h?? */ /* nd6.c */ void nd6_init __P((void)); +#ifdef VIMAGE +void nd6_destroy __P((void)); +#endif struct nd_ifinfo *nd6_ifattach __P((struct ifnet *)); void nd6_ifdetach __P((struct nd_ifinfo *)); int nd6_is_addr_neighbor __P((struct sockaddr_in6 *, struct ifnet *)); |
