summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-09-07 00:45:15 +0000
committerbz <bz@FreeBSD.org>2011-09-07 00:45:15 +0000
commitd5bccf0f290a379883f36b2c5757eaf53088e7ec (patch)
tree26ccb914c9b3ce2a4813d3ece932ef3c305bf119 /usr.sbin/bsdinstall
parent802a4d0e44b4d947b20e707e7031b29fc0b228ec (diff)
downloadFreeBSD-src-d5bccf0f290a379883f36b2c5757eaf53088e7ec.zip
FreeBSD-src-d5bccf0f290a379883f36b2c5757eaf53088e7ec.tar.gz
Fix two problems:
1) if no default gateway is given the route command will fail and the script will abort with an error leading to an endless loop unless configuration is cancelled or changed. [1] 2) In the IPv6 case add -inet6 to not alter the legacy IP default route. Reported by: Oleg Ginzburg (olevole olevole.ru) [1] Tested by: Oleg Ginzburg (olevole olevole.ru) [1] Approved by: re (kib)
Diffstat (limited to 'usr.sbin/bsdinstall')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv46
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv66
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
index 6b479ad..ec359d7 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -79,7 +79,9 @@ echo $INTERFACE $IF_CONFIG |
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE`
- route delete -inet default
- route add -inet default $defaultrouter
+ if [ -n "${defaultrouter}" ]; then
+ route delete -inet default
+ route add -inet default $defaultrouter
+ fi
fi
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
index 8bff816..dc0d69f 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -142,7 +142,9 @@ BEGIN {
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig ${INTERFACE} `eval echo \\\$ifconfig_${INTERFACE}_ipv6`
- route delete default
- route add default ${ipv6_defaultrouter}
+ if [ -n "${ipv6_defaultrouter}" ]; then
+ route delete -inet6 default
+ route add -inet6 default ${ipv6_defaultrouter}
+ fi
fi
OpenPOWER on IntegriCloud