Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc check for IPv6 kernel by exit status of "ifconfig lo0 in...



details:   https://anonhg.NetBSD.org/src/rev/0bf643090b3e
branches:  trunk
changeset: 479734:0bf643090b3e
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Dec 20 15:12:23 1999 +0000

description:
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.

diffstat:

 etc/netstart |  20 +++++++++++++++-----
 etc/rc.conf  |   4 ++--
 2 files changed, 17 insertions(+), 7 deletions(-)

diffs (70 lines):

diff -r fd328f427c7b -r 0bf643090b3e etc/netstart
--- a/etc/netstart      Mon Dec 20 14:36:11 1999 +0000
+++ b/etc/netstart      Mon Dec 20 15:12:23 1999 +0000
@@ -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 @@
 
 # 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 @@
        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 @@
                        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
diff -r fd328f427c7b -r 0bf643090b3e etc/rc.conf
--- a/etc/rc.conf       Mon Dec 20 14:36:11 1999 +0000
+++ b/etc/rc.conf       Mon Dec 20 15:12:23 1999 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index