Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp
authorian <ian@FreeBSD.org>
Sun, 27 Mar 2016 22:21:34 +0000 (22:21 +0000)
committerian <ian@FreeBSD.org>
Sun, 27 Mar 2016 22:21:34 +0000 (22:21 +0000)
commit98d4fdf9925d2672ecbffc3bd68da169deee158c
tree8863a9d3f9f5df2ba69690c33705f173128ae385
parent7e32590e6ee222f1c24d7f5f4edd7dd88acd83ea
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
sys/nfs/bootp_subr.c