Browse Source

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
OPENBSD_3_9
todd 18 years ago
parent
commit
3b5bf93ce3
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      src/etc/netstart

+ 10
- 2
src/etc/netstart View File

@ -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.


Loading…
Cancel
Save