Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Sep 2011 00:45:15 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225429 - head/usr.sbin/bsdinstall/scripts
Message-ID:  <201109070045.p870jFrb008231@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Wed Sep  7 00:45:15 2011
New Revision: 225429
URL: http://svn.freebsd.org/changeset/base/225429

Log:
  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)

Modified:
  head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
  head/usr.sbin/bsdinstall/scripts/netconfig_ipv6

Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4	Wed Sep  7 00:43:28 2011	(r225428)
+++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4	Wed Sep  7 00:45:15 2011	(r225429)
@@ -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
 

Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv6
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/netconfig_ipv6	Wed Sep  7 00:43:28 2011	(r225428)
+++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv6	Wed Sep  7 00:45:15 2011	(r225429)
@@ -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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109070045.p870jFrb008231>