diff options
author | bz <bz@FreeBSD.org> | 2010-05-06 06:44:19 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2010-05-06 06:44:19 +0000 |
commit | 70e6f14e44387c54e20403484badf917d9b74589 (patch) | |
tree | 5305eacadb412df61b0d8de24da9051c2210f495 /sys/netinet6/in6_proto.c | |
parent | 3e52c1f894aa8fc2b8031ef275b1fb830a25bb6f (diff) | |
download | FreeBSD-src-70e6f14e44387c54e20403484badf917d9b74589.zip FreeBSD-src-70e6f14e44387c54e20403484badf917d9b74589.tar.gz |
MFC r207369:
MFP4: @176978-176982, 176984, 176990-176994, 177441
"Whitspace" churn after the VIMAGE/VNET whirls.
Remove the need for some "init" functions within the network
stack, like pim6_init(), icmp_init() or significantly shorten
others like ip6_init() and nd6_init(), using static initialization
again where possible and formerly missed.
Move (most) variables back to the place they used to be before the
container structs and VIMAGE_GLOABLS (before r185088) and try to
reduce the diff to stable/7 and earlier as good as possible,
to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9.
This also removes some header file pollution for putatively
static global variables.
Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are
no longer needed.
Reviewed by: jhb
Discussed with: rwatson
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
Diffstat (limited to 'sys/netinet6/in6_proto.c')
-rw-r--r-- | sys/netinet6/in6_proto.c | 84 |
1 files changed, 53 insertions, 31 deletions
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 40acb1e..351fdc3 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -234,7 +234,6 @@ struct ip6protosw inet6sw[] = { .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, - .pr_init = icmp6_init, .pr_fasttimo = icmp6_fasttimo, .pr_slowtimo = icmp6_slowtimo, .pr_usrreqs = &rip6_usrreqs @@ -378,25 +377,44 @@ VNET_DOMAIN_SET(inet6); /* * Internet configuration info */ -VNET_DEFINE(int, ip6_forwarding); -VNET_DEFINE(int, ip6_sendredirects); -VNET_DEFINE(int, ip6_defhlim); -VNET_DEFINE(int, ip6_defmcasthlim); -VNET_DEFINE(int, ip6_accept_rtadv); -VNET_DEFINE(int, ip6_maxfragpackets); -VNET_DEFINE(int, ip6_maxfrags); -VNET_DEFINE(int, ip6_log_interval); -VNET_DEFINE(int, ip6_hdrnestlimit); -VNET_DEFINE(int, ip6_dad_count); -VNET_DEFINE(int, ip6_auto_flowlabel); -VNET_DEFINE(int, ip6_use_deprecated); -VNET_DEFINE(int, ip6_rr_prune); -VNET_DEFINE(int, ip6_mcast_pmtu); -VNET_DEFINE(int, ip6_v6only); -VNET_DEFINE(int, ip6_keepfaith); -VNET_DEFINE(time_t, ip6_log_time); -VNET_DEFINE(int, ip6stealth); -VNET_DEFINE(int, nd6_onlink_ns_rfc4861); +#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 + +VNET_DEFINE(int, ip6_forwarding) = IPV6FORWARDING; /* act as router? */ +VNET_DEFINE(int, ip6_sendredirects) = IPV6_SENDREDIRECTS; +VNET_DEFINE(int, ip6_defhlim) = IPV6_DEFHLIM; +VNET_DEFINE(int, ip6_defmcasthlim) = IPV6_DEFAULT_MULTICAST_HOPS; +VNET_DEFINE(int, ip6_accept_rtadv) = 0; +VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ +VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */ +VNET_DEFINE(int, ip6_log_interval) = 5; +VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we + * process? */ +VNET_DEFINE(int, ip6_dad_count) = 1; /* DupAddrDetectionTransmits */ +VNET_DEFINE(int, ip6_auto_flowlabel) = 1; +VNET_DEFINE(int, ip6_use_deprecated) = 1;/* allow deprecated addr + * (RFC2462 5.5.4) */ +VNET_DEFINE(int, ip6_rr_prune) = 5; /* router renumbering prefix + * walk list every 5 sec. */ +VNET_DEFINE(int, ip6_mcast_pmtu) = 0; /* enable pMTU discovery for multicast? */ +VNET_DEFINE(int, ip6_v6only) = 1; + +VNET_DEFINE(int, ip6_keepfaith) = 0; +VNET_DEFINE(time_t, ip6_log_time) = (time_t)0L; +#ifdef IPSTEALTH +VNET_DEFINE(int, ip6stealth) = 0; +#endif +VNET_DEFINE(int, nd6_onlink_ns_rfc4861) = 0;/* allow 'on-link' nd6 NS + * (RFC 4861) */ /* icmp6 */ /* @@ -404,26 +422,31 @@ VNET_DEFINE(int, nd6_onlink_ns_rfc4861); * XXX: what if we don't define INET? Should we define pmtu6_expire * or so? (jinmei@kame.net 19990310) */ -VNET_DEFINE(int, pmtu_expire); -VNET_DEFINE(int, pmtu_probe); +VNET_DEFINE(int, pmtu_expire) = 60*10; +VNET_DEFINE(int, pmtu_probe) = 60*2; /* raw IP6 parameters */ /* * Nominal space allocated to a raw ip socket. */ -VNET_DEFINE(u_long, rip6_sendspace); -VNET_DEFINE(u_long, rip6_recvspace); +#define RIPV6SNDQ 8192 +#define RIPV6RCVQ 8192 + +VNET_DEFINE(u_long, rip6_sendspace) = RIPV6SNDQ; +VNET_DEFINE(u_long, rip6_recvspace) = RIPV6RCVQ; /* ICMPV6 parameters */ -VNET_DEFINE(int, icmp6_rediraccept); -VNET_DEFINE(int, icmp6_redirtimeout); -VNET_DEFINE(int, icmp6errppslim); +VNET_DEFINE(int, icmp6_rediraccept) = 1;/* accept and process redirects */ +VNET_DEFINE(int, icmp6_redirtimeout) = 10 * 60; /* 10 minutes */ +VNET_DEFINE(int, icmp6errppslim) = 100; /* 100pps */ /* control how to respond to NI queries */ -VNET_DEFINE(int, icmp6_nodeinfo); +VNET_DEFINE(int, icmp6_nodeinfo) = + (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); /* UDP on IP6 parameters */ -VNET_DEFINE(int, udp6_sendspace); -VNET_DEFINE(int, udp6_recvspace); +VNET_DEFINE(int, udp6_sendspace) = 9216;/* really max datagram size */ +VNET_DEFINE(int, udp6_recvspace) = 40 * (1024 + sizeof(struct sockaddr_in6)); + /* 40 1K datagrams */ /* * sysctl related items. @@ -567,7 +590,6 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG, nd6_debug, CTLFLAG_RW, &VNET_NAME(nd6_debug), 0, ""); - SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861, nd6_onlink_ns_rfc4861, CTLFLAG_RW, &VNET_NAME(nd6_onlink_ns_rfc4861), 0, "Accept 'on-link' nd6 NS in compliance with RFC 4861."); |