If compiling RESCUE always ignore feature_present(3) calls so that

a /rescue/ifconfig more modern than the kernel could still configure
IPv4 or IPv6 addresses.

Reported by:	Andrzej Tobola (ato iem.pw.edu.pl)
Reported by:	gcooper
MFC after:	1 day
X-MFC:		will not MFC any time soon, just reminder for r222527
This commit is contained in:
Bjoern A. Zeeb 2011-07-18 10:29:16 +00:00
parent 1bc399c4b1
commit ad2571a225
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224179
3 changed files with 7 additions and 0 deletions

View File

@ -200,7 +200,10 @@ static struct afswtch af_inet = {
static __constructor void
inet_ctor(void)
{
#ifndef RESCUE
if (!feature_present("inet"))
return;
#endif
af_register(&af_inet);
}

View File

@ -545,8 +545,10 @@ inet6_ctor(void)
#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
#ifndef RESCUE
if (!feature_present("inet6"))
return;
#endif
for (i = 0; i < N(inet6_cmds); i++)
cmd_register(&inet6_cmds[i]);

View File

@ -498,9 +498,11 @@ ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp)
* ifconfig IF up/down etc. to work without INET support as people
* never used ifconfig IF link up/down, etc. either.
*/
#ifndef RESCUE
#ifdef INET
if (afp == NULL && feature_present("inet"))
afp = af_getbyname("inet");
#endif
#endif
if (afp == NULL)
afp = af_getbyname("link");