Source-Changes-HG archive

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

[src/netbsd-1-6]: src/etc/rc.d Pullup rev 1.44 (requested by itojun in ticket...



details:   https://anonhg.NetBSD.org/src/rev/a998e8b86ff6
branches:  netbsd-1-6
changeset: 531374:a998e8b86ff6
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sat Jun 05 04:55:45 2004 +0000

description:
Pullup rev 1.44 (requested by itojun in ticket #1704)

Allow an IPv6 default route to be set from /etc/mygate6 or $defaultroute6.

diffstat:

 etc/rc.d/network |  24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 73da6e7b0d12 -r a998e8b86ff6 etc/rc.d/network
--- a/etc/rc.d/network  Thu Jun 03 21:07:01 2004 +0000
+++ b/etc/rc.d/network  Sat Jun 05 04:55:45 2004 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: network,v 1.38.2.1 2002/10/23 12:34:40 lukem Exp $
+# $NetBSD: network,v 1.38.2.2 2004/06/05 04:55:45 jmc Exp $
 #
 
 # PROVIDE: network
@@ -224,8 +224,9 @@
                echo "."
        fi
 
-       # Check $defaultroute, then /etc/mygate, for the name of my gateway
-       # host. That name must be in /etc/hosts.
+       # Check $defaultroute, then /etc/mygate, for the name or address
+       # of my IPv4 gateway host. If using a name, that name must be in
+       # /etc/hosts.
        #
        if [ -z "$defaultroute" ] && [ -f /etc/mygate ]; then
                defaultroute=`cat /etc/mygate`
@@ -234,6 +235,23 @@
                route add default $defaultroute
        fi
 
+       # Check $defaultroute6, then /etc/mygate6, for the name or address
+       # of my IPv6 gateway host. If using a name, that name must be in
+       # /etc/hosts.  Note that the gateway host address must be a link-local
+       # address if it is not using an stf* interface.
+       #
+       if [ -z "$defaultroute6" ] && [ -f /etc/mygate6 ]; then
+               defaultroute6=`cat /etc/mygate6`
+       fi
+       if [ -n "$defaultroute6" ]; then
+               if [ "$ip6mode" = "autohost" ]; then
+                       echo
+                       warn \
+           "ip6mode is set to 'autohost' and a v6 default route is also set."
+               fi
+               route add -inet6 default $defaultroute6
+       fi
+
        # Check if each configured interface xxN has an $ifaliases_xxN variable
        # associated, then configure additional IP addresses for that interface.
        # The variable contains a list of "address netmask" pairs, with



Home | Main Index | Thread Index | Old Index