subr_hints: Fix acpi unit hinting (at the very least)

The refactoring in r335479 overlooked the fact that the dynamic kenv can
also be switched to if hintmode == 0. This is problematic because the
checkmethod bits are only ever ran once, but it worked previously because
the use_kenv was a global state and the first lookup would enable it if
occurring after the dynamic environment has been setup.

Extending our local definition of use_kenv to include all non-STATIC
hintmodes as long as the dynamic_kenv is setup fixes this. We still have
potential issues if the dynamic kenv comes up while we're doing an anchored
search through the environment, but this is not much of a concern right now
because:

1.) The dynamic environment comes up super early in boot, just after kmem

2.) This is going to get rewritten to provide a safer mechanism for the
anchored searches, ensuring that we continue using the same environment
chain (dynamic env or static fallback) for all anchored search invocations

Reported by:	mmamcy
X-MFC-With: r335479
This commit is contained in:
Kyle Evans 2018-06-21 21:50:00 +00:00
parent 1fcf4de055
commit 03d7aee8a7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335509

View File

@ -123,7 +123,7 @@ res_find(int *line, int *startln,
{
int n = 0, hit, i = 0;
char r_name[32];
int r_unit, use_kenv = (hintmode == HINTMODE_FALLBACK);
int r_unit, use_kenv = (hintmode != HINTMODE_STATIC && dynamic_kenv);
char r_resname[32];
char r_value[128];
const char *s, *cp;