From owner-svn-src-all@FreeBSD.ORG Wed Sep 7 00:45:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC58110656EE; Wed, 7 Sep 2011 00:45:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2888FC0C; Wed, 7 Sep 2011 00:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p870jFFF008234; Wed, 7 Sep 2011 00:45:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p870jFrb008231; Wed, 7 Sep 2011 00:45:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109070045.p870jFrb008231@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 7 Sep 2011 00:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225429 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2011 00:45:15 -0000 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