Re: [patch] ipv4: Update ip command line processing (take II)

2007-12-25 Thread Simon Horman
On Tue, Dec 25, 2007 at 08:55:43PM -0800, David Miller wrote:
> From: Simon Horman <[EMAIL PROTECTED]>
> Date: Wed, 26 Dec 2007 11:59:05 +0900
> 
> > 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 <[EMAIL PROTECTED]>
> > Signed-off-by: Simon Horman <[EMAIL PROTECTED]>
> 
> I applied this to net-2.6 since I think it's a bug fix, and
> I also tailored the changelog header to more it clear this
> is a fix not just an "Update". :-)

Ok, thanks.

-- 
Horms

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] ipv4: Update ip command line processing (take II)

2007-12-25 Thread David Miller
From: Simon Horman <[EMAIL PROTECTED]>
Date: Wed, 26 Dec 2007 11:59:05 +0900

> 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 <[EMAIL PROTECTED]>
> Signed-off-by: Simon Horman <[EMAIL PROTECTED]>

I applied this to net-2.6 since I think it's a bug fix, and
I also tailored the changelog header to more it clear this
is a fix not just an "Update". :-)

Thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] ipv4: Update ip command line processing (take II)

2007-12-25 Thread Simon Horman
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 <[EMAIL PROTECTED]>
Signed-off-by: Simon Horman <[EMAIL PROTECTED]>

--- 
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.0 +0900
+++ net-2.6.25/net/ipv4/ipconfig.c  2007-12-26 11:57:04.0 +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.0 
+0900
+++ net-2.6.25/Documentation/nfsroot.txt2007-12-26 11:57:04.0 
+0900
@@ -97,10 +97,6 @@ ip=:::  IP address of the client.
 
Default:  Determined using autoconfiguration.
@@ -150,6 +146,7 @@ ip=:::http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] ipv4: Update ip command line processing (take II)

2007-12-25 Thread Simon Horman
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 [EMAIL PROTECTED]
Signed-off-by: Simon Horman [EMAIL PROTECTED]

--- 
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.0 +0900
+++ net-2.6.25/net/ipv4/ipconfig.c  2007-12-26 11:57:04.0 +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.0 
+0900
+++ net-2.6.25/Documentation/nfsroot.txt2007-12-26 11:57:04.0 
+0900
@@ -97,10 +97,6 @@ ip=client-ip:server-ip:gw-ip:netm
   autoconfiguration will take place.  The most common way to use this
   is ip=dhcp.
 
-  Note that ip=off is not the same thing as ip=::off, because in
-  the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP
-  are compiled in the kernel.
-
   client-ip  IP address of the client.
 
Default:  Determined using autoconfiguration.
@@ -150,6 +146,7 @@ ip=client-ip:server-ip:gw-ip:netm
 
   off or none: don't use autoconfiguration
  on or any:   use any protocol available in the kernel
+  (default)
  dhcp:use DHCP
  bootp:   use BOOTP
  rarp:use RARP
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] ipv4: Update ip command line processing (take II)

2007-12-25 Thread David Miller
From: Simon Horman [EMAIL PROTECTED]
Date: Wed, 26 Dec 2007 11:59:05 +0900

 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 [EMAIL PROTECTED]
 Signed-off-by: Simon Horman [EMAIL PROTECTED]

I applied this to net-2.6 since I think it's a bug fix, and
I also tailored the changelog header to more it clear this
is a fix not just an Update. :-)

Thanks!

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] ipv4: Update ip command line processing (take II)

2007-12-25 Thread Simon Horman
On Tue, Dec 25, 2007 at 08:55:43PM -0800, David Miller wrote:
 From: Simon Horman [EMAIL PROTECTED]
 Date: Wed, 26 Dec 2007 11:59:05 +0900
 
  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 [EMAIL PROTECTED]
  Signed-off-by: Simon Horman [EMAIL PROTECTED]
 
 I applied this to net-2.6 since I think it's a bug fix, and
 I also tailored the changelog header to more it clear this
 is a fix not just an Update. :-)

Ok, thanks.

-- 
Horms

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/