Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbXLZC7W (ORCPT ); Tue, 25 Dec 2007 21:59:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751381AbXLZC7K (ORCPT ); Tue, 25 Dec 2007 21:59:10 -0500 Received: from koto.vergenet.net ([210.128.90.7]:56709 "EHLO koto.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751325AbXLZC7J (ORCPT ); Tue, 25 Dec 2007 21:59:09 -0500 Date: Wed, 26 Dec 2007 11:59:05 +0900 From: Simon Horman To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Amos Waterland , David Miller Subject: [patch] ipv4: Update ip command line processing (take II) Message-ID: <20071226025903.GB14422@verge.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: mutt-ng/devel-r804 (Debian) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2825 Lines: 77 Recently the documentation in Documentation/nfsroot.txt was update to note that in fact ip=off and ip=::::::off as the latter is ignored and the default (on) is used. This was certainly a step in the direction of reducing confusion. But it seems to me that the code ought to be fixed up so that ip=::::::off actually turns off ip autoconfiguration. This patch also notes more specifically that ip=on (aka ip=::::::on) is the default. Cc: Amos Waterland Signed-off-by: Simon Horman --- Fri, 21 Dec 2007 16:48:16 +0900 * Removed check on if (name) in ic_proto_name(). It should have been if (*name == '\0'), but even then its a bit bogus, providing an early exit for a code-path that is called approximately once. Index: net-2.6.25/net/ipv4/ipconfig.c =================================================================== --- net-2.6.25.orig/net/ipv4/ipconfig.c 2007-12-26 11:56:20.000000000 +0900 +++ net-2.6.25/net/ipv4/ipconfig.c 2007-12-26 11:57:04.000000000 +0900 @@ -1417,6 +1417,10 @@ static int __init ic_proto_name(char *na if (!strcmp(name, "on") || !strcmp(name, "any")) { return 1; } + if (!strcmp(name, "off") || !strcmp(name, "none")) { + ic_enable = 0; + return 1; + } #ifdef CONFIG_IP_PNP_DHCP else if (!strcmp(name, "dhcp")) { ic_proto_enabled &= ~IC_RARP; @@ -1451,12 +1455,6 @@ static int __init ip_auto_config_setup(c ic_set_manually = 1; - ic_enable = (*addrs && - (strcmp(addrs, "off") != 0) && - (strcmp(addrs, "none") != 0)); - if (!ic_enable) - return 1; - if (ic_proto_name(addrs)) return 1; Index: net-2.6.25/Documentation/nfsroot.txt =================================================================== --- net-2.6.25.orig/Documentation/nfsroot.txt 2007-12-26 11:56:20.000000000 +0900 +++ net-2.6.25/Documentation/nfsroot.txt 2007-12-26 11:57:04.000000000 +0900 @@ -97,10 +97,6 @@ ip=::: IP address of the client. Default: Determined using autoconfiguration. @@ -150,6 +146,7 @@ ip=:::