summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2010-04-09 01:35:09 +0000
committerdougb <dougb@FreeBSD.org>2010-04-09 01:35:09 +0000
commit2ae521fa83381fb37d51c9fbaa4bf010e9118a70 (patch)
tree04c99d982a6edeed63d52af2b85b3cad62c33907 /etc/rc.d
parent4f086c2604dc3f689c57c6e0619187d74ddb1ca2 (diff)
downloadFreeBSD-src-2ae521fa83381fb37d51c9fbaa4bf010e9118a70.zip
FreeBSD-src-2ae521fa83381fb37d51c9fbaa4bf010e9118a70.tar.gz
Improve the handling of IPv6 configuration in rc.d. The ipv6_enable
and ipv6_ifconfig_<interface> options have already been deprecated, these changes do not alter that. With these changes any value set for ipv6_enable will emit a warning. In order to avoid a POLA violation for the deprecation of the option ipv6_enable=NO will still disable configuration for all interfaces other than lo0. ipv6_enable=YES will not have any effect, but will emit an additional warning. Support and warnings for this option will be removed in FreeBSD 10.x. Consistent with the current code, in order for IPv6 to be configured on an interface (other than lo0) an ifconfig_<interface>_ipv6 option will have to be added to /etc/rc.conf[.local]. 1. Clean up and minor optimizations for the following functions: ifconfig_up (the ipv6 elements) ipv6if ipv6_autoconfif get_if_var _ifconfig_getargs The cleanups generally were to move the "easy" tests earlier in the functions, and consolidate duplicate code. 2. Stop overloading ipv6_prefer with the ability to disable IPv6 configuration. 3. Remove noafif() which was only ever called from ipv6_autoconfif. Instead, simplify and integrate the tests into that function, and convert the test to use is_wired_interface() instead of listing wireless interfaces explicitly. 4. Integrate backwards compatibility for ipv6_ifconfig_<interface> into _ifconfig_getargs. This dramatically simplifies the code in all of the callers, and avoids a lot of other code duplication. 5. In rc.d/netoptions, add code for an ipv6_privacy option to use RFC 4193 style pseudo-random addresses (this is what windows does by default, FYI). 6. Add support for the [NO]RTADV options in ifconfig_getargs() and ipv6_autoconfif(). In the latter, include support for the explicit addition of [-]accept_rtadv in ifconfig_<interface>_ipv6 as is done in the current code. 7. In rc.d/netif add a warning if $ipv6_enable is set, and remove the set_rcvar_obsolete for it. Also remove the latter from rc.d/ip6addrctl. 8. In /etc/defaults/rc.conf: Add an example for RTADV configuration. Set ipv6_network_interfaces to AUTO. Switch ipv6_prefer to YES. If ipv6_enable is not set this will have no effect. Add a default for ipv6_privacy (NO). 9. Document all of this in rc.conf.5.
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/ip6addrctl2
-rwxr-xr-xetc/rc.d/netif9
-rwxr-xr-xetc/rc.d/netoptions7
3 files changed, 15 insertions, 3 deletions
diff --git a/etc/rc.d/ip6addrctl b/etc/rc.d/ip6addrctl
index d3b1856..3963b07 100755
--- a/etc/rc.d/ip6addrctl
+++ b/etc/rc.d/ip6addrctl
@@ -20,8 +20,6 @@ status_cmd="ip6addrctl"
prefer_ipv6_cmd="ip6addrctl_prefer_ipv6"
prefer_ipv4_cmd="ip6addrctl_prefer_ipv4"
-set_rcvar_obsolete ipv6_enable ipv6_prefer
-
ip6addrctl_prefer_ipv6()
{
afexists inet6 || return 0
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index f982cfc..06b8e76 100755
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -34,6 +34,7 @@
. /etc/network.subr
name="network"
+start_precmd="network_prestart"
start_cmd="network_start"
stop_cmd="network_stop"
cloneup_cmd="clone_up"
@@ -41,7 +42,13 @@ clonedown_cmd="clone_down"
extra_commands="cloneup clonedown"
cmdifn=
-set_rcvar_obsolete ipv6_enable ipv6_prefer
+network_prestart()
+{
+ if [ -n "$ipv6_enable" ]; then
+ warn 'The ipv6_enable option is deprecated.'
+ warn 'See rc.conf(5) for information on disabling IPv6.'
+ fi
+}
network_start()
{
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index 4631304..433ce82 100755
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -99,6 +99,13 @@ netoptions_inet6()
else
${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
fi
+
+ if checkyesno ipv6_privacy; then
+ netoptions_init
+ echo -n " IPv6 Privacy Addresses"
+ ${SYSCTL_W} net.inet6.ip6.use_tempaddr=1 >/dev/null
+ ${SYSCTL_W} net.inet6.ip6.prefer_tempaddr=1 >/dev/null
+ fi
}
load_rc_config $name
OpenPOWER on IntegriCloud