summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/frag6.c2
-rw-r--r--sys/netinet6/icmp6.c13
-rw-r--r--sys/netinet6/in6_ifattach.c12
-rw-r--r--sys/netinet6/in6_proto.c81
-rw-r--r--sys/netinet6/in6_rmx.c23
-rw-r--r--sys/netinet6/in6_src.c10
-rw-r--r--sys/netinet6/ip6_forward.c2
-rw-r--r--sys/netinet6/ip6_input.c87
-rw-r--r--sys/netinet6/ip6_mroute.c21
-rw-r--r--sys/netinet6/mld6.c2
-rw-r--r--sys/netinet6/nd6.c71
-rw-r--r--sys/netinet6/nd6_nbr.c10
-rw-r--r--sys/netinet6/nd6_rtr.c16
-rw-r--r--sys/netinet6/raw_ip6.c2
-rw-r--r--sys/netinet6/scope6.c14
-rw-r--r--sys/netinet6/vinet6.h2
16 files changed, 256 insertions, 112 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index 961af87..391ce92 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -77,9 +77,11 @@ static struct mtx ip6qlock;
/*
* These fields all protected by ip6qlock.
*/
+#ifdef VIMAGE_GLOBALS
static u_int frag6_nfragpackets;
static u_int frag6_nfrags;
static struct ip6q ip6q; /* ip6 reassemble queue */
+#endif
#define IP6Q_LOCK_INIT() mtx_init(&ip6qlock, "ip6qlock", NULL, MTX_DEF);
#define IP6Q_LOCK() mtx_lock(&ip6qlock)
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 65ef96c..4a1557f 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -108,16 +108,17 @@ __FBSDID("$FreeBSD$");
#endif
extern struct domain inet6domain;
-
-struct icmp6stat icmp6stat;
-
extern struct inpcbinfo ripcbinfo;
extern struct inpcbhead ripcb;
extern int icmp6errppslim;
-static int icmp6errpps_count = 0;
-static struct timeval icmp6errppslim_last;
extern int icmp6_nodeinfo;
+#ifdef VIMAGE_GLOBALS
+struct icmp6stat icmp6stat;
+static int icmp6errpps_count;
+static struct timeval icmp6errppslim_last;
+#endif
+
static void icmp6_errcount(struct icmp6errstat *, int, int);
static int icmp6_rip6_input(struct mbuf **, int);
static int icmp6_ratelimit(const struct in6_addr *, const int, const int);
@@ -138,6 +139,8 @@ icmp6_init(void)
{
INIT_VNET_INET6(curvnet);
+ V_icmp6errpps_count = 0;
+
mld6_init();
}
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index a51f59c..3fdfc8c 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -61,15 +61,11 @@ __FBSDID("$FreeBSD$");
#include <netinet6/nd6.h>
#include <netinet6/scope6_var.h>
-unsigned long in6_maxmtu = 0;
-
-#ifdef IP6_AUTO_LINKLOCAL
-int ip6_auto_linklocal = IP6_AUTO_LINKLOCAL;
-#else
-int ip6_auto_linklocal = 1; /* enable by default */
-#endif
-
+#ifdef VIMAGE_GLOBALS
+unsigned long in6_maxmtu;
+int ip6_auto_linklocal;
struct callout in6_tmpaddrtimer_ch;
+#endif
extern struct inpcbinfo udbinfo;
extern struct inpcbinfo ripcbinfo;
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index ca221fe..c4ded5e 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -368,73 +368,56 @@ DOMAIN_SET(inet6);
/*
* Internet configuration info
*/
-#ifndef IPV6FORWARDING
-#ifdef GATEWAY6
-#define IPV6FORWARDING 1 /* forward IP6 packets not for us */
-#else
-#define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */
-#endif /* GATEWAY6 */
-#endif /* !IPV6FORWARDING */
-
-#ifndef IPV6_SENDREDIRECTS
-#define IPV6_SENDREDIRECTS 1
-#endif
-
-int ip6_forwarding = IPV6FORWARDING; /* act as router? */
-int ip6_sendredirects = IPV6_SENDREDIRECTS;
-int ip6_defhlim = IPV6_DEFHLIM;
-int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
-int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */
-int ip6_maxfragpackets; /* initialized in frag6.c:frag6_init() */
-int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */
-int ip6_log_interval = 5;
-int ip6_hdrnestlimit = 15; /* How many header options will we process? */
-int ip6_dad_count = 1; /* DupAddrDetectionTransmits */
-int ip6_auto_flowlabel = 1;
-int ip6_gif_hlim = 0;
-int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
-int ip6_rr_prune = 5; /* router renumbering prefix
- * walk list every 5 sec. */
-int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */
-int ip6_v6only = 1;
-
-int ip6_keepfaith = 0;
-time_t ip6_log_time = (time_t)0L;
-#ifdef IPSTEALTH
-int ip6stealth = 0;
+#ifdef VIMAGE_GLOBALS
+int ip6_forwarding;
+int ip6_sendredirects;
+int ip6_defhlim;
+int ip6_defmcasthlim;
+int ip6_accept_rtadv;
+int ip6_maxfragpackets;
+int ip6_maxfrags;
+int ip6_log_interval;
+int ip6_hdrnestlimit;
+int ip6_dad_count;
+int ip6_auto_flowlabel;
+int ip6_use_deprecated;
+int ip6_rr_prune;
+int ip6_mcast_pmtu;
+int ip6_v6only;
+int ip6_keepfaith;
+time_t ip6_log_time;
+int ip6stealth;
+int nd6_onlink_ns_rfc4861;
#endif
-int nd6_onlink_ns_rfc4861 = 0; /* allow 'on-link' nd6 NS (as in RFC 4861) */
+#ifdef VIMAGE_GLOBALS
/* icmp6 */
/*
* BSDI4 defines these variables in in_proto.c...
* XXX: what if we don't define INET? Should we define pmtu6_expire
* or so? (jinmei@kame.net 19990310)
*/
-int pmtu_expire = 60*10;
-int pmtu_probe = 60*2;
+int pmtu_expire;
+int pmtu_probe;
/* raw IP6 parameters */
/*
* Nominal space allocated to a raw ip socket.
*/
-#define RIPV6SNDQ 8192
-#define RIPV6RCVQ 8192
-
-u_long rip6_sendspace = RIPV6SNDQ;
-u_long rip6_recvspace = RIPV6RCVQ;
+u_long rip6_sendspace;
+u_long rip6_recvspace;
/* ICMPV6 parameters */
-int icmp6_rediraccept = 1; /* accept and process redirects */
-int icmp6_redirtimeout = 10 * 60; /* 10 minutes */
-int icmp6errppslim = 100; /* 100pps */
+int icmp6_rediraccept;
+int icmp6_redirtimeout;
+int icmp6errppslim;
/* control how to respond to NI queries */
-int icmp6_nodeinfo = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
+int icmp6_nodeinfo;
/* UDP on IP6 parameters */
-int udp6_sendspace = 9216; /* really max datagram size */
-int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
- /* 40 1K datagrams */
+int udp6_sendspace;
+int udp6_recvspace;
+#endif /* VIMAGE_GLOBALS */
/*
* sysctl related items.
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index ff426dc..0936a92 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -219,18 +219,18 @@ in6_matroute(void *v_arg, struct radix_node_head *head)
SYSCTL_DECL(_net_inet6_ip6);
-static int rtq_reallyold6 = 60*60;
- /* one hour is ``really old'' */
+#ifdef VIMAGE_GLOBALS
+static int rtq_reallyold6;
+static int rtq_minreallyold6;
+static int rtq_toomany6;
+#endif
+
SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire,
CTLFLAG_RW, &rtq_reallyold6 , 0, "");
-static int rtq_minreallyold6 = 10;
- /* never automatically crank down to less */
SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire,
CTLFLAG_RW, &rtq_minreallyold6 , 0, "");
-static int rtq_toomany6 = 128;
- /* 128 cached routes is ``too many'' */
SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMAXCACHE, rtmaxcache,
CTLFLAG_RW, &rtq_toomany6 , 0, "");
@@ -324,8 +324,10 @@ in6_rtqkill(struct radix_node *rn, void *rock)
}
#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
-static int rtq_timeout6 = RTQ_TIMEOUT;
+#ifdef VIMAGE_GLOBALS
+static int rtq_timeout6;
static struct callout rtq_timer6;
+#endif
static void
in6_rtqtimo(void *rock)
@@ -387,7 +389,9 @@ struct mtuex_arg {
struct radix_node_head *rnh;
time_t nextstop;
};
+#ifdef VIMAGE_GLOBALS
static struct callout rtq_mtutimer;
+#endif
static int
in6_mtuexpire(struct radix_node *rn, void *rock)
@@ -478,6 +482,11 @@ in6_inithead(void **head, int off)
if (off == 0) /* See above */
return 1; /* only do the rest for the real thing */
+ V_rtq_reallyold6 = 60*60; /* one hour is ``really old'' */
+ V_rtq_minreallyold6 = 10; /* never automatically crank down to less */
+ V_rtq_toomany6 = 128; /* 128 cached routes is ``too many'' */
+ V_rtq_timeout6 = RTQ_TIMEOUT;
+
rnh = *head;
rnh->rnh_addaddr = in6_addroute;
rnh->rnh_matchaddr = in6_matroute;
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 1bb673d..b38869e 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -119,9 +119,11 @@ static struct sx addrsel_sxlock;
#define ADDRSEL_XUNLOCK() sx_xunlock(&addrsel_sxlock)
#define ADDR_LABEL_NOTAPP (-1)
-struct in6_addrpolicy defaultaddrpolicy;
-int ip6_prefer_tempaddr = 0;
+#ifdef VIMAGE_GLOBALS
+struct in6_addrpolicy defaultaddrpolicy;
+int ip6_prefer_tempaddr;
+#endif
static int selectroute __P((struct sockaddr_in6 *, struct ip6_pktopts *,
struct ip6_moptions *, struct route_in6 *, struct ifnet **,
@@ -875,6 +877,8 @@ addrsel_policy_init(void)
ADDRSEL_SXLOCK_INIT();
INIT_VNET_INET6(curvnet);
+ V_ip6_prefer_tempaddr = 0;
+
init_policy_queue();
/* initialize the "last resort" policy */
@@ -972,7 +976,9 @@ struct addrsel_policyent {
TAILQ_HEAD(addrsel_policyhead, addrsel_policyent);
+#ifdef VIMAGE_GLOBALS
struct addrsel_policyhead addrsel_policytab;
+#endif
static void
init_policy_queue(void)
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index 8745b08..7571507 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$");
#include <netinet6/ip6protosw.h>
+#ifdef VIMAGE_GLOBALS
struct route_in6 ip6_forward_rt;
+#endif
/*
* Forward a packet. If some error occurs return the sender
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 8bd178f..320042f 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -116,21 +116,34 @@ extern struct domain inet6domain;
u_char ip6_protox[IPPROTO_MAX];
static struct ifqueue ip6intrq;
-static int ip6qmaxlen = IFQ_MAXLEN;
+
+#ifdef VIMAGE_GLOBALS
+static int ip6qmaxlen;
struct in6_ifaddr *in6_ifaddr;
+struct ip6stat ip6stat;
+#endif
extern struct callout in6_tmpaddrtimer_ch;
+extern int dad_init;
+extern int pmtu_expire;
+extern int pmtu_probe;
+extern u_long rip6_sendspace;
+extern u_long rip6_recvspace;
+extern int icmp6errppslim;
+extern int icmp6_nodeinfo;
+extern int udp6_sendspace;
+extern int udp6_recvspace;
+
+#ifdef VIMAGE_GLOBALS
int ip6_forward_srcrt; /* XXX */
int ip6_sourcecheck; /* XXX */
int ip6_sourcecheck_interval; /* XXX */
-
int ip6_ours_check_algorithm;
+#endif
struct pfil_head inet6_pfil_hook;
-struct ip6stat ip6stat;
-
static void ip6_init2(void *);
static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *);
static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *);
@@ -149,6 +162,72 @@ ip6_init(void)
struct ip6protosw *pr;
int i;
+ V_ip6qmaxlen = IFQ_MAXLEN;
+ V_in6_maxmtu = 0;
+#ifdef IP6_AUTO_LINKLOCAL
+ V_ip6_auto_linklocal = IP6_AUTO_LINKLOCAL;
+#else
+ V_ip6_auto_linklocal = 1; /* enable by default */
+#endif
+
+#ifndef IPV6FORWARDING
+#ifdef GATEWAY6
+#define IPV6FORWARDING 1 /* forward IP6 packets not for us */
+#else
+#define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */
+#endif /* GATEWAY6 */
+#endif /* !IPV6FORWARDING */
+
+#ifndef IPV6_SENDREDIRECTS
+#define IPV6_SENDREDIRECTS 1
+#endif
+
+ V_ip6_forwarding = IPV6FORWARDING; /* act as router? */
+ V_ip6_sendredirects = IPV6_SENDREDIRECTS;
+ V_ip6_defhlim = IPV6_DEFHLIM;
+ V_ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
+ V_ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */
+ V_ip6_log_interval = 5;
+ V_ip6_hdrnestlimit = 15; /* How many header options will we process? */
+ V_ip6_dad_count = 1; /* DupAddrDetectionTransmits */
+ V_ip6_auto_flowlabel = 1;
+ V_ip6_use_deprecated = 1;/* allow deprecated addr (RFC2462 5.5.4) */
+ V_ip6_rr_prune = 5; /* router renumbering prefix
+ * walk list every 5 sec. */
+ V_ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */
+ V_ip6_v6only = 1;
+ V_ip6_keepfaith = 0;
+ V_ip6_log_time = (time_t)0L;
+#ifdef IPSTEALTH
+ V_ip6stealth = 0;
+#endif
+ V_nd6_onlink_ns_rfc4861 = 0; /* allow 'on-link' nd6 NS (RFC 4861) */
+
+ V_pmtu_expire = 60*10;
+ V_pmtu_probe = 60*2;
+
+ /* raw IP6 parameters */
+ /*
+ * Nominal space allocated to a raw ip socket.
+ */
+#define RIPV6SNDQ 8192
+#define RIPV6RCVQ 8192
+ V_rip6_sendspace = RIPV6SNDQ;
+ V_rip6_recvspace = RIPV6RCVQ;
+
+ /* ICMPV6 parameters */
+ V_icmp6_rediraccept = 1; /* accept and process redirects */
+ V_icmp6_redirtimeout = 10 * 60; /* 10 minutes */
+ V_icmp6errppslim = 100; /* 100pps */
+ /* control how to respond to NI queries */
+ V_icmp6_nodeinfo = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
+
+ /* UDP on IP6 parameters */
+ V_udp6_sendspace = 9216; /* really max datagram size */
+ V_udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
+ /* 40 1K datagrams */
+ V_dad_init = 0;
+
#ifdef DIAGNOSTIC
if (sizeof(struct protosw) != sizeof(struct ip6protosw))
panic("sizeof(protosw) != sizeof(ip6protosw)");
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 61a6e5c..2ae6ed8 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -129,6 +129,7 @@ static MALLOC_DEFINE(M_MRTABLE6, "mf6c", "multicast forwarding cache entry");
static int ip6_mdq(struct mbuf *, struct ifnet *, struct mf6c *);
static void phyint_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
+static void pim6_init(void);
static int set_pim6(int *);
static int socket_send __P((struct socket *, struct mbuf *,
struct sockaddr_in6 *));
@@ -146,10 +147,13 @@ struct ip6protosw in6_pim_protosw = {
.pr_input = pim6_input,
.pr_output = rip6_output,
.pr_ctloutput = rip6_ctloutput,
+ .pr_init = pim6_init,
.pr_usrreqs = &rip6_usrreqs
};
-static int ip6_mrouter_ver = 0;
+#ifdef VIMAGE_GLOBALS
+static int ip6_mrouter_ver;
+#endif
SYSCTL_DECL(_net_inet6);
SYSCTL_DECL(_net_inet6_ip6);
@@ -177,7 +181,9 @@ SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mif6table, CTLFLAG_RD,
"Multicast Interfaces (struct mif[MAXMIFS], netinet6/ip6_mroute.h)");
#ifdef MRT6DEBUG
+#ifdef VIMAGE_GLOBALS
static u_int mrt6debug = 0; /* debug level */
+#endif
#define DEBUG_MFC 0x02
#define DEBUG_FORWARD 0x04
#define DEBUG_EXPIRE 0x08
@@ -222,7 +228,9 @@ SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RD,
&pim6stat, pim6stat,
"PIM Statistics (struct pim6stat, netinet6/pim_var.h)");
+#ifdef VIMAGE_GLOBALS
static int pim6;
+#endif
/*
* Hash function for a source, group entry
@@ -302,6 +310,17 @@ int X_ip6_mrouter_set(struct socket *so, struct sockopt *sopt);
int X_ip6_mrouter_get(struct socket *so, struct sockopt *sopt);
int X_mrt6_ioctl(int cmd, caddr_t data);
+static void
+pim6_init(void)
+{
+ INIT_VNET_INET6(curvnet);
+
+ V_ip6_mrouter_ver = 0;
+#ifdef MRT6DEBUG
+ V_mrt6debug = 0; /* debug level */
+#endif
+}
+
/*
* Handle MRT setsockopt commands to modify the multicast routing tables.
*/
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 7bfd2c4..9c6bbdb 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -104,7 +104,9 @@ __FBSDID("$FreeBSD$");
*/
#define MLD_UNSOLICITED_REPORT_INTERVAL 10
+#ifdef VIMAGE_GLOBALS
static struct ip6_pktopts ip6_opts;
+#endif
static void mld6_sendpkt(struct in6_multi *, int, const struct in6_addr *);
static void mld_starttimer(struct in6_multi *);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 2ea6330..dfe0016 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -79,34 +79,32 @@ __FBSDID("$FreeBSD$");
#define SIN6(s) ((struct sockaddr_in6 *)s)
#define SDL(s) ((struct sockaddr_dl *)s)
-/* timer values */
-int nd6_prune = 1; /* walk list every 1 seconds */
-int nd6_delay = 5; /* delay first probe time 5 second */
-int nd6_umaxtries = 3; /* maximum unicast query */
-int nd6_mmaxtries = 3; /* maximum multicast query */
-int nd6_useloopback = 1; /* use loopback interface for local traffic */
-int nd6_gctimer = (60 * 60 * 24); /* 1 day: garbage collection timer */
+#ifdef VIMAGE_GLOBALS
+int nd6_prune;
+int nd6_delay;
+int nd6_umaxtries;
+int nd6_mmaxtries;
+int nd6_useloopback;
+int nd6_gctimer;
/* preventing too many loops in ND option parsing */
-int nd6_maxndopt = 10; /* max # of ND options allowed */
+int nd6_maxndopt;
-int nd6_maxnudhint = 0; /* max # of subsequent upper layer hints */
-int nd6_maxqueuelen = 1; /* max # of packets cached in unresolved ND entries */
+int nd6_maxnudhint;
+int nd6_maxqueuelen;
-#ifdef ND6_DEBUG
-int nd6_debug = 1;
-#else
-int nd6_debug = 0;
-#endif
+int nd6_debug;
/* for debugging? */
static int nd6_inuse, nd6_allocated;
+struct llinfo_nd6 llinfo_nd6;
-struct llinfo_nd6 llinfo_nd6 = {&llinfo_nd6, &llinfo_nd6};
struct nd_drhead nd_defrouter;
-struct nd_prhead nd_prefix = { 0 };
+struct nd_prhead nd_prefix;
+
+int nd6_recalc_reachtm_interval;
+#endif /* VIMAGE_GLOBALS */
-int nd6_recalc_reachtm_interval = ND6_RECALC_REACHTM_INTERVAL;
static struct sockaddr_in6 all1_sa;
static int nd6_is_new_addr_neighbor __P((struct sockaddr_in6 *,
@@ -118,9 +116,13 @@ static struct llinfo_nd6 *nd6_free(struct rtentry *, int);
static void nd6_llinfo_timer(void *);
static void clear_llinfo_pqueue(struct llinfo_nd6 *);
+#ifdef VIMAGE_GLOBALS
struct callout nd6_slowtimo_ch;
struct callout nd6_timer_ch;
extern struct callout in6_tmpaddrtimer_ch;
+extern int dad_ignore_ns;
+extern int dad_maxtry;
+#endif
void
nd6_init(void)
@@ -134,6 +136,39 @@ nd6_init(void)
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 */
+ V_nd6_mmaxtries = 3; /* maximum multicast query */
+ V_nd6_useloopback = 1; /* use loopback interface for local traffic */
+ V_nd6_gctimer = (60 * 60 * 24); /* 1 day: garbage collection timer */
+
+ /* preventing too many loops in ND option parsing */
+ V_nd6_maxndopt = 10; /* max # of ND options allowed */
+
+ V_nd6_maxnudhint = 0; /* max # of subsequent upper layer hints */
+ V_nd6_maxqueuelen = 1; /* max pkts cached in unresolved ND entries */
+
+#ifdef ND6_DEBUG
+ V_nd6_debug = 1;
+#else
+ V_nd6_debug = 0;
+#endif
+
+ V_nd6_recalc_reachtm_interval = ND6_RECALC_REACHTM_INTERVAL;
+
+ V_dad_ignore_ns = 0; /* ignore NS in DAD - specwise incorrect*/
+ V_dad_maxtry = 15; /* max # of *tries* to transmit DAD packet */
+
+ V_llinfo_nd6.ln_next = &V_llinfo_nd6;
+ V_llinfo_nd6.ln_prev = &V_llinfo_nd6;
+ LIST_INIT(&V_nd_prefix);
+
+ ip6_use_tempaddr = 0;
+ ip6_temp_preferred_lifetime = DEF_TEMP_PREFERRED_LIFETIME;
+ ip6_temp_valid_lifetime = DEF_TEMP_VALID_LIFETIME;
+ ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE;
+
all1_sa.sin6_family = AF_INET6;
all1_sa.sin6_len = sizeof(struct sockaddr_in6);
for (i = 0; i < sizeof(all1_sa.sin6_addr); i++)
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index f87a7a82..9d04c1b 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -86,8 +86,10 @@ static void nd6_dad_ns_output(struct dadq *, struct ifaddr *);
static void nd6_dad_ns_input(struct ifaddr *);
static void nd6_dad_na_input(struct ifaddr *);
-static int dad_ignore_ns = 0; /* ignore NS in DAD - specwise incorrect*/
-static int dad_maxtry = 15; /* max # of *tries* to transmit DAD packet */
+#ifdef VIMAGE_GLOBALS
+int dad_ignore_ns;
+int dad_maxtry;
+#endif
/*
* Input a Neighbor Solicitation Message.
@@ -1096,8 +1098,10 @@ struct dadq {
struct callout dad_timer_ch;
};
+#ifdef VIMAGE_GLOBALS
static struct dadq_head dadq;
-static int dad_init = 0;
+int dad_init;
+#endif
static struct dadq *
nd6_dad_find(struct ifaddr *ifa)
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index a1f891b..31f06a7 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -87,20 +87,16 @@ static int rt6_deleteroute(struct radix_node *, void *);
extern int nd6_recalc_reachtm_interval;
+#ifdef VIMAGE_GLOBALS
static struct ifnet *nd6_defifp;
int nd6_defifindex;
-int ip6_use_tempaddr = 0;
-
+int ip6_use_tempaddr;
int ip6_desync_factor;
-u_int32_t ip6_temp_preferred_lifetime = DEF_TEMP_PREFERRED_LIFETIME;
-u_int32_t ip6_temp_valid_lifetime = DEF_TEMP_VALID_LIFETIME;
-/*
- * shorter lifetimes for debugging purposes.
-int ip6_temp_preferred_lifetime = 800;
-static int ip6_temp_valid_lifetime = 1800;
-*/
-int ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE;
+u_int32_t ip6_temp_preferred_lifetime;
+u_int32_t ip6_temp_valid_lifetime;
+int ip6_temp_regen_advance;
+#endif
/* RTPREF_MEDIUM has to be 0! */
#define RTPREF_HIGH 1
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index d365ec4..ece033e 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -117,7 +117,9 @@ extern struct inpcbinfo ripcbinfo;
extern u_long rip_sendspace;
extern u_long rip_recvspace;
+#ifdef VIMAGE_GLOBALS
struct rip6stat rip6stat;
+#endif
/*
* Hooks for multicast forwarding.
diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c
index 4c6b860..4bb84d9 100644
--- a/sys/netinet6/scope6.c
+++ b/sys/netinet6/scope6.c
@@ -50,11 +50,6 @@ __FBSDID("$FreeBSD$");
#include <netinet6/in6_var.h>
#include <netinet6/scope6_var.h>
-#ifdef ENABLE_DEFAULT_SCOPE
-int ip6_use_defzone = 1;
-#else
-int ip6_use_defzone = 0;
-#endif
/*
* The scope6_lock protects the global sid default stored in
@@ -66,7 +61,11 @@ static struct mtx scope6_lock;
#define SCOPE6_UNLOCK() mtx_unlock(&scope6_lock)
#define SCOPE6_LOCK_ASSERT() mtx_assert(&scope6_lock, MA_OWNED)
+#ifdef VIMAGE_GLOBALS
static struct scope6_id sid_default;
+int ip6_use_defzone;
+#endif
+
#define SID(ifp) \
(((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->scope6_id)
@@ -75,6 +74,11 @@ scope6_init(void)
{
INIT_VNET_INET6(curvnet);
+#ifdef ENABLE_DEFAULT_SCOPE
+ V_ip6_use_defzone = 1;
+#else
+ V_ip6_use_defzone = 0;
+#endif
SCOPE6_LOCK_INIT();
bzero(&V_sid_default, sizeof(V_sid_default));
}
diff --git a/sys/netinet6/vinet6.h b/sys/netinet6/vinet6.h
index 992e6e7..5c5455c 100644
--- a/sys/netinet6/vinet6.h
+++ b/sys/netinet6/vinet6.h
@@ -108,6 +108,7 @@ struct vnet_inet6 {
int _ip6_keepfaith;
int _ip6stealth;
time_t _ip6_log_time;
+ int _nd6_onlink_ns_rfc4861;
int _pmtu_expire;
int _pmtu_probe;
@@ -232,6 +233,7 @@ struct vnet_inet6 {
#define V_nd6_maxnudhint VNET_INET6(nd6_maxnudhint)
#define V_nd6_maxqueuelen VNET_INET6(nd6_maxqueuelen)
#define V_nd6_mmaxtries VNET_INET6(nd6_mmaxtries)
+#define V_nd6_onlink_ns_rfc4861 VNET_INET6(nd6_onlink_ns_rfc4861)
#define V_nd6_prune VNET_INET6(nd6_prune)
#define V_nd6_recalc_reachtm_interval VNET_INET6(nd6_recalc_reachtm_interval)
#define V_nd6_slowtimo_ch VNET_INET6(nd6_slowtimo_ch)
OpenPOWER on IntegriCloud