nd6.c (181803) | nd6.c (181887) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: nd6.c,v 1.144 2001/05/24 07:44:00 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: nd6.c,v 1.144 2001/05/24 07:44:00 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet6/nd6.c 181803 2008-08-17 23:27:27Z bz $"); | 33__FBSDID("$FreeBSD: head/sys/netinet6/nd6.c 181887 2008-08-20 01:05:56Z julian $"); |
34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_mac.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/callout.h> --- 93 unchanged lines hidden (view full) --- 135 136 all1_sa.sin6_family = AF_INET6; 137 all1_sa.sin6_len = sizeof(struct sockaddr_in6); 138 for (i = 0; i < sizeof(all1_sa.sin6_addr); i++) 139 all1_sa.sin6_addr.s6_addr[i] = 0xff; 140 141 /* initialization of the default router list */ 142 TAILQ_INIT(&V_nd_defrouter); | 34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_mac.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/callout.h> --- 93 unchanged lines hidden (view full) --- 135 136 all1_sa.sin6_family = AF_INET6; 137 all1_sa.sin6_len = sizeof(struct sockaddr_in6); 138 for (i = 0; i < sizeof(all1_sa.sin6_addr); i++) 139 all1_sa.sin6_addr.s6_addr[i] = 0xff; 140 141 /* initialization of the default router list */ 142 TAILQ_INIT(&V_nd_defrouter); |
143 144 nd6_init_done = 1; 145 | |
146 /* start timer */ 147 callout_init(&V_nd6_slowtimo_ch, 0); 148 callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, 149 nd6_slowtimo, NULL); | 143 /* start timer */ 144 callout_init(&V_nd6_slowtimo_ch, 0); 145 callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, 146 nd6_slowtimo, NULL); |
147 148 nd6_init_done = 1; 149 |
|
150} 151 152struct nd_ifinfo * 153nd6_ifattach(struct ifnet *ifp) 154{ 155 struct nd_ifinfo *nd; 156 157 nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK); --- 1728 unchanged lines hidden (view full) --- 1886nd6_slowtimo(void *ignored_arg) 1887{ 1888 struct nd_ifinfo *nd6if; 1889 struct ifnet *ifp; 1890 1891 callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, 1892 nd6_slowtimo, NULL); 1893 IFNET_RLOCK(); | 150} 151 152struct nd_ifinfo * 153nd6_ifattach(struct ifnet *ifp) 154{ 155 struct nd_ifinfo *nd; 156 157 nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK); --- 1728 unchanged lines hidden (view full) --- 1886nd6_slowtimo(void *ignored_arg) 1887{ 1888 struct nd_ifinfo *nd6if; 1889 struct ifnet *ifp; 1890 1891 callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, 1892 nd6_slowtimo, NULL); 1893 IFNET_RLOCK(); |
1894 for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { | 1894 for (ifp = TAILQ_FIRST(&V_ifnet); ifp; 1895 ifp = TAILQ_NEXT(ifp, if_list)) { |
1895 nd6if = ND_IFINFO(ifp); 1896 if (nd6if->basereachable && /* already initialized */ 1897 (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { 1898 /* 1899 * Since reachable time rarely changes by router 1900 * advertisements, we SHOULD insure that a new random 1901 * value gets recomputed at least once every few hours. 1902 * (RFC 2461, 6.3.4) --- 496 unchanged lines hidden --- | 1896 nd6if = ND_IFINFO(ifp); 1897 if (nd6if->basereachable && /* already initialized */ 1898 (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { 1899 /* 1900 * Since reachable time rarely changes by router 1901 * advertisements, we SHOULD insure that a new random 1902 * value gets recomputed at least once every few hours. 1903 * (RFC 2461, 6.3.4) --- 496 unchanged lines hidden --- |