aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipconfig.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-09 11:05:12 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-09 11:05:12 -0500
commitfd0b45dfd1858c6b49d06355a460bcf36d654c06 (patch)
tree85386a76355b398b7f452b737af4ab48f116677a /net/ipv4/ipconfig.c
parentfcfd50afb6e94c8cf121ca4e7e3e7166bae7c6aa (diff)
parent1c9b7aa1eb40ab708ef3242f74b9a61487623168 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (36 commits) [ATM]: Check IP header validity in mpc_send_packet [IPV6]: IPV6_MULTICAST_IF setting is ignored on link-local connect() [CONNECTOR]: Don't touch queue dev after decrement of ref count. [SOCK]: Adds a rcu_dereference() in sk_filter [XFRM]: xfrm_algo_clone() allocates too much memory [FORCEDETH]: Fix reversing the MAC address on suspend. [NET]: mcs7830 passes msecs instead of jiffies to usb_control_msg [LRO] Fix lro_mgr->features checks [NET]: Clone the sk_buff 'iif' field in __skb_clone() [IPV4] ROUTE: ip_rt_dump() is unecessary slow [NET]: kaweth was forgotten in msec switchover of usb_start_wait_urb [NET] Intel ethernet drivers: update MAINTAINERS [NET]: Make ->poll() breakout consistent in Intel ethernet drivers. [NET]: Stop polling when napi_disable() is pending. [NET]: Fix drivers to handle napi_disable() disabling interrupts. [NETXEN]: Fix ->poll() done logic. mac80211: return an error when SIWRATE doesn't match any rate ssb: Fix probing of PCI cores if PCI and PCIE core is available [NET]: Do not check netif_running() and carrier state in ->poll() [NET]: Add NAPI_STATE_DISABLE. ...
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r--net/ipv4/ipconfig.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 56a675734ea5..b8f7763b2261 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1404,8 +1404,7 @@ static int __init ic_proto_name(char *name)
1404 return 1; 1404 return 1;
1405 } 1405 }
1406 if (!strcmp(name, "off") || !strcmp(name, "none")) { 1406 if (!strcmp(name, "off") || !strcmp(name, "none")) {
1407 ic_enable = 0; 1407 return 0;
1408 return 1;
1409 } 1408 }
1410#ifdef CONFIG_IP_PNP_DHCP 1409#ifdef CONFIG_IP_PNP_DHCP
1411 else if (!strcmp(name, "dhcp")) { 1410 else if (!strcmp(name, "dhcp")) {
@@ -1442,10 +1441,22 @@ static int __init ip_auto_config_setup(char *addrs)
1442 ic_set_manually = 1; 1441 ic_set_manually = 1;
1443 ic_enable = 1; 1442 ic_enable = 1;
1444 1443
1444 /*
1445 * If any dhcp, bootp etc options are set, leave autoconfig on
1446 * and skip the below static IP processing.
1447 */
1445 if (ic_proto_name(addrs)) 1448 if (ic_proto_name(addrs))
1446 return 1; 1449 return 1;
1447 1450
1448 /* Parse the whole string */ 1451 /* If no static IP is given, turn off autoconfig and bail. */
1452 if (*addrs == 0 ||
1453 strcmp(addrs, "off") == 0 ||
1454 strcmp(addrs, "none") == 0) {
1455 ic_enable = 0;
1456 return 1;
1457 }
1458
1459 /* Parse string for static IP assignment. */
1449 ip = addrs; 1460 ip = addrs;
1450 while (ip && *ip) { 1461 while (ip && *ip) {
1451 if ((cp = strchr(ip, ':'))) 1462 if ((cp = strchr(ip, ':')))
@@ -1483,7 +1494,10 @@ static int __init ip_auto_config_setup(char *addrs)
1483 strlcpy(user_dev_name, ip, sizeof(user_dev_name)); 1494 strlcpy(user_dev_name, ip, sizeof(user_dev_name));
1484 break; 1495 break;
1485 case 6: 1496 case 6:
1486 ic_proto_name(ip); 1497 if (ic_proto_name(ip) == 0 &&
1498 ic_myaddr == NONE) {
1499 ic_enable = 0;
1500 }
1487 break; 1501 break;
1488 } 1502 }
1489 } 1503 }