]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r338020: res_find: Fix fallback logic
authorkevans <kevans@FreeBSD.org>
Fri, 24 Aug 2018 02:21:14 +0000 (02:21 +0000)
committerkevans <kevans@FreeBSD.org>
Fri, 24 Aug 2018 02:21:14 +0000 (02:21 +0000)
commitc809e82331b80edf65a732c71a168b9249825c9d
tree231ee4b274910bb2ee9b590f1840ce3faec57bab
parent920d8770ed40014ab6720f36667a4fc373cb2ee1
MFC r338020: res_find: Fix fallback logic

The fallback logic was broken if hints were found in multiple environments.
If we found a hint in either the loader environment or the static
environment, fallback would be incremented excessively when we returned to
the environment-selection bits. These checks should have also been guarded
by the fbacklvl checks. As a result, fbacklvl could quickly get to a point
where we skip either the static environment and/or the static hints
depending on which environments contained valid hints.

The impact of this bug is minimal, mostly affecting mips boards that use
static hints and may have hints in either the loader environment or the
static environment.

There may be better ways to express the searchable environments and
describing their characteristics (immutable, already searched, etc.) but
this may be revisited after 12 branches.
sys/kern/subr_hints.c