Look for both name and if_<name> strings in module metadata. Pseudo-devices

like tun are naming their modules using the 'if_; prefix and previous version of
the code failed to detect their presence in the kernel, resulting in the same
module being loaded twice.
This commit is contained in:
Alexander Kabaev 2004-02-27 06:43:14 +00:00
parent a0a7e17219
commit 652d6e18bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126301

View File

@ -1849,7 +1849,8 @@ ifmaybeload(char *name)
cp = mstat.name;
}
/* already loaded? */
if (!strncmp(name, cp, strlen(cp)))
if (strncmp(name, cp, strlen(cp)) == 0 ||
strncmp(ifkind, cp, strlen(cp)) == 0)
return;
}
}