summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-07-18 10:29:16 +0000
committerbz <bz@FreeBSD.org>2011-07-18 10:29:16 +0000
commit7a0d48ebc3311ca8354f797d5fd2a5411af66086 (patch)
tree78daff93b0e2f102bb54157a0ae4df5dfc7ba8b2 /sbin
parent94656ca305cce2dc4b2fc31d0f556398dea3a845 (diff)
downloadFreeBSD-src-7a0d48ebc3311ca8354f797d5fd2a5411af66086.zip
FreeBSD-src-7a0d48ebc3311ca8354f797d5fd2a5411af66086.tar.gz
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/af_inet.c3
-rw-r--r--sbin/ifconfig/af_inet6.c2
-rw-r--r--sbin/ifconfig/ifconfig.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c
index 6b4d735..19e27c9 100644
--- a/sbin/ifconfig/af_inet.c
+++ b/sbin/ifconfig/af_inet.c
@@ -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);
}
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index 585be05..e39c1c8 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -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]);
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 408d77e..af280ce 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -498,10 +498,12 @@ 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");
if (afp == NULL) {
OpenPOWER on IntegriCloud