From owner-svn-src-all@FreeBSD.ORG Mon Jul 18 10:29:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 991BB106566B; Mon, 18 Jul 2011 10:29:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F57A8FC08; Mon, 18 Jul 2011 10:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IATGDA019460; Mon, 18 Jul 2011 10:29:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IATG0k019456; Mon, 18 Jul 2011 10:29:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107181029.p6IATG0k019456@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 18 Jul 2011 10:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224179 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 10:29:16 -0000 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) {