summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2005-10-14 15:46:42 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2005-10-14 15:46:42 +0000
commit9efd76fbfee31678bd5cf9b13a6a2f6ac3280f38 (patch)
treebc43dd7b411400012376c16e27660312080277bd
parent5694f68839fd055853f71435b09b09d9c5091bc6 (diff)
add v6 support for /etc/mygate
ok deraadt@ mickey@ krw@ same functionality tested/ok'ed by by mickey, brad, matthieu, and me with this one may now put a v6 IP in /etc/mygate on a separate line from the v4 default gateway and netstart will do the right thing
-rw-r--r--etc/netstart12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/netstart b/etc/netstart
index 397d6c551c7..866c4537fee 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.108 2005/10/12 13:11:55 todd Exp $
+# $OpenBSD: netstart,v 1.109 2005/10/14 15:46:41 todd Exp $
# Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout
@@ -312,7 +312,15 @@ ifmstart "trunk vlan pfsync carp"
# that name must be in /etc/hosts.
if [ "X${setgateway}" != X"N" -a -f /etc/mygate ]; then
route -qn delete default > /dev/null 2>&1
- route -qn add -host default `stripcom /etc/mygate`
+ route -qn delete -inet6 default > /dev/null 2>&1
+ # Now parse the mygate file
+ stripcom /etc/mygate | while read gw; do
+ case "$gw" in
+ *:*) af=-inet6;;
+ *) af=;;
+ esac
+ route -qn add -host $af default $gw
+ done
fi
# Multicast routing.