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
This commit is contained in:
parent
faaf0c6eaa
commit
eb2d4f022c
@ -1478,6 +1478,8 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx,
|
||||
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_diskless *nd, struct bootpc_ifcontext *ifctx,
|
||||
}
|
||||
printf("rootfs %s ", p);
|
||||
gctx->gotrootpath = 1;
|
||||
ifctx->gotrootpath = 1;
|
||||
gctx->setrootfs = ifctx;
|
||||
|
||||
p = bootpc_tag(&gctx->tag, &ifctx->reply,
|
||||
|
Loading…
x
Reference in New Issue
Block a user