check for IPv6 kernel by exit status of "ifconfig lo0 inet6".
now IPv6 portion of netstart does not require /usr mount, it will mount it as necessary (like pppd configuration do). thanks goes to christos for the tip.
This commit is contained in:
parent
ece19a5225
commit
c7a34c1de0
20
etc/netstart
20
etc/netstart
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: netstart,v 1.65 1999/12/09 14:18:07 itojun Exp $
|
||||
# $NetBSD: netstart,v 1.66 1999/12/20 15:12:23 itojun Exp $
|
||||
# from: @(#)netstart 8.1 (Berkeley) 7/23/93
|
||||
|
||||
if [ -f /etc/rc.subr ]; then
|
||||
|
@ -199,10 +199,15 @@ fi
|
|||
|
||||
# IPv6
|
||||
# Note that manual configuration can be done in the above, using ifconfig.
|
||||
dadcount=`sysctl -n net.inet6.ip6.dad_count 2>/dev/null`
|
||||
if [ "x$dadcount" = "x" ]; then
|
||||
# IPv6 is not configured in the kernel. do not bother.
|
||||
ifconfig lo0 inet6 >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
# We do not have IPv6 support in kernel.
|
||||
if checkyesno ip6forwarding || checkyesno rtsol; then
|
||||
echo "WARNING: ip6 requested without kernel IPv6 config"
|
||||
fi
|
||||
else
|
||||
# We have IPv6 support in kernel.
|
||||
|
||||
# disallow scoped unicast dest without outgoing scope identifiers.
|
||||
route add -inet6 fe80:: -prefixlen 10 ::1 -reject
|
||||
route add -inet6 fc80:: -prefixlen 10 ::1 -reject
|
||||
|
@ -212,6 +217,9 @@ else
|
|||
route add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject
|
||||
route add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject
|
||||
|
||||
# sysctl is in /usr - need to ensure it is mounted
|
||||
mount /usr >/dev/null 2>&1
|
||||
|
||||
sysctl -w net.inet6.ip6.forwarding=0
|
||||
sysctl -w net.inet6.ip6.accept_rtadv=0
|
||||
if checkyesno ip6forwarding; then
|
||||
|
@ -227,8 +235,10 @@ else
|
|||
rtsol $rtsol_flags
|
||||
fi
|
||||
fi
|
||||
|
||||
# wait till DAD is completed.
|
||||
# outside of the loop in case ifconfig is used
|
||||
# always invoke it in case if are configured manually by ifconfig
|
||||
dadcount=`sysctl -n net.inet6.ip6.dad_count 2>/dev/null`
|
||||
sleep $dadcount
|
||||
sleep 1
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: rc.conf,v 1.63 1999/12/06 20:38:13 abs Exp $
|
||||
# $NetBSD: rc.conf,v 1.64 1999/12/20 15:12:23 itojun Exp $
|
||||
#
|
||||
# see rc.conf(5) for more information.
|
||||
|
||||
|
@ -28,7 +28,7 @@ defaultroute="" # if blank, use /etc/mygate
|
|||
domainname="" # if blank, use /etc/defaultdomain
|
||||
|
||||
# Filesystems to mount early in boot-up
|
||||
critical_filesystems_beforenet="/usr /var" # "netstart" needs /usr
|
||||
critical_filesystems_beforenet="/var"
|
||||
critical_filesystems=""
|
||||
|
||||
# Set this to YES if you have purposefully setup no swap partitions and
|
||||
|
|
Loading…
Reference in New Issue