Date: Mon, 18 Jul 2011 10:29:16 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r224179 - head/sbin/ifconfig Message-ID: <201107181029.p6IATG0k019456@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Mon Jul 18 10:29:16 2011 New Revision: 224179 URL: http://svn.freebsd.org/changeset/base/224179 Log: 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 Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Mon Jul 18 08:38:08 2011 (r224178) +++ head/sbin/ifconfig/af_inet.c Mon Jul 18 10:29:16 2011 (r224179) @@ -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); } Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Mon Jul 18 08:38:08 2011 (r224178) +++ head/sbin/ifconfig/af_inet6.c Mon Jul 18 10:29:16 2011 (r224179) @@ -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]); Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Mon Jul 18 08:38:08 2011 (r224178) +++ head/sbin/ifconfig/ifconfig.c Mon Jul 18 10:29:16 2011 (r224179) @@ -498,10 +498,12 @@ ifconfig(int argc, char *const *argv, in * 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107181029.p6IATG0k019456>