Date: Sun, 27 Mar 2016 22:21:34 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297323 - head/sys/nfs Message-ID: <201603272221.u2RMLYUL002972@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603272221.u2RMLYUL002972>