From owner-svn-src-all@FreeBSD.ORG Tue May 25 03:08:47 2010 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 BE533106564A; Tue, 25 May 2010 03:08:47 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4FA8FC0C; Tue, 25 May 2010 03:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4P38lQL094782; Tue, 25 May 2010 03:08:47 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4P38lml094780; Tue, 25 May 2010 03:08:47 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201005250308.o4P38lml094780@svn.freebsd.org> From: Randi Harper Date: Tue, 25 May 2010 03:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208529 - stable/8/usr.sbin/sysinstall 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: Tue, 25 May 2010 03:08:47 -0000 Author: randi Date: Tue May 25 03:08:47 2010 New Revision: 208529 URL: http://svn.freebsd.org/changeset/base/208529 Log: MFC r208407: Flush all routes before adding the default route in order to allow sysinstall to cleanly re-initialize the network. PR: bin/145553 Submitted by: gcooper Approved by: cperciva (mentor) Modified: stable/8/usr.sbin/sysinstall/network.c Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/network.c ============================================================================== --- stable/8/usr.sbin/sysinstall/network.c Tue May 25 02:52:10 2010 (r208528) +++ stable/8/usr.sbin/sysinstall/network.c Tue May 25 03:08:47 2010 (r208529) @@ -141,12 +141,22 @@ mediaInitNetwork(Device *dev) } rp = variable_get(VAR_GATEWAY); if (!rp || *rp == '0') { - msgConfirm("No gateway has been set. You may be unable to access hosts\n" + msgConfirm("No gateway has been set. You will be unable to access hosts\n" "not on your local network"); } else { + /* + * Explicitly flush all routes to get back to a known sane + * state. We don't need to check this exit code because if + * anything fails it will show up in the route add below. + */ + system("route -n flush"); msgDebug("Adding default route to %s.\n", rp); - vsystem("route -n add default %s", rp); + if (vsystem("route -n add default %s", rp) != 0) { + msgConfirm("Failed to add a default route; please check " + "your network configuration"); + return FALSE; + } } } else { msgDebug("A DHCP interface. Should already be up.\n");