From owner-svn-src-all@freebsd.org Sun Mar 27 22:21:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07F39ADFDE4; Sun, 27 Mar 2016 22:21:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9E921F94; Sun, 27 Mar 2016 22:21:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RMLYdk002973; Sun, 27 Mar 2016 22:21:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RMLYUL002972; Sun, 27 Mar 2016 22:21:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603272221.u2RMLYUL002972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 27 Mar 2016 22:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297323 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 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: Sun, 27 Mar 2016 22:21:36 -0000 Author: ian Date: Sun Mar 27 22:21:34 2016 New Revision: 297323 URL: https://svnweb.freebsd.org/changeset/base/297323 Log: Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp server (and not when it came from a fallback method such as the ROOTDEVNAME option). This makes the code in bootpc_init() choose the first interface that provided a rootpath name. Previously it was choosing the first interface that got an IP address, which could be on a different and potentially unreachable subnet than the server providing the rootfs. If the rootpath name actually does come from a fallback source, then the code continues to use the first interface in the list that got configured. Note that this wasn't directly reported in the PR cited below, but was discovered while working on that PR. PR: 187094 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sun Mar 27 21:20:43 2016 (r297322) +++ head/sys/nfs/bootp_subr.c Sun Mar 27 22:21:34 2016 (r297323) @@ -1478,6 +1478,8 @@ bootpc_decode_reply(struct nfsv3_diskles if (p == NULL) { p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, TAG_ROOT); + if (p != NULL) + ifctx->gotrootpath = 1; } #ifdef ROOTDEVNAME if ((p == NULL || (boothowto & RB_DFLTROOT) != 0) && @@ -1497,7 +1499,6 @@ bootpc_decode_reply(struct nfsv3_diskles } printf("rootfs %s ", p); gctx->gotrootpath = 1; - ifctx->gotrootpath = 1; gctx->setrootfs = ifctx; p = bootpc_tag(&gctx->tag, &ifctx->reply,