diff options
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r-- | net/ipv4/ipconfig.c | 79 |
1 files changed, 43 insertions, 36 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index ab7e5542c1c..004bb74b41c 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -252,6 +252,10 @@ static int __init ic_open_devs(void) | |||
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
255 | /* no point in waiting if we could not bring up at least one device */ | ||
256 | if (!ic_first_dev) | ||
257 | goto have_carrier; | ||
258 | |||
255 | /* wait for a carrier on at least one device */ | 259 | /* wait for a carrier on at least one device */ |
256 | start = jiffies; | 260 | start = jiffies; |
257 | while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) { | 261 | while (jiffies - start < msecs_to_jiffies(CONF_CARRIER_TIMEOUT)) { |
@@ -861,41 +865,44 @@ static void __init ic_do_bootp_ext(u8 *ext) | |||
861 | #endif | 865 | #endif |
862 | 866 | ||
863 | switch (*ext++) { | 867 | switch (*ext++) { |
864 | case 1: /* Subnet mask */ | 868 | case 1: /* Subnet mask */ |
865 | if (ic_netmask == NONE) | 869 | if (ic_netmask == NONE) |
866 | memcpy(&ic_netmask, ext+1, 4); | 870 | memcpy(&ic_netmask, ext+1, 4); |
867 | break; | 871 | break; |
868 | case 3: /* Default gateway */ | 872 | case 3: /* Default gateway */ |
869 | if (ic_gateway == NONE) | 873 | if (ic_gateway == NONE) |
870 | memcpy(&ic_gateway, ext+1, 4); | 874 | memcpy(&ic_gateway, ext+1, 4); |
871 | break; | 875 | break; |
872 | case 6: /* DNS server */ | 876 | case 6: /* DNS server */ |
873 | servers= *ext/4; | 877 | servers= *ext/4; |
874 | if (servers > CONF_NAMESERVERS_MAX) | 878 | if (servers > CONF_NAMESERVERS_MAX) |
875 | servers = CONF_NAMESERVERS_MAX; | 879 | servers = CONF_NAMESERVERS_MAX; |
876 | for (i = 0; i < servers; i++) { | 880 | for (i = 0; i < servers; i++) { |
877 | if (ic_nameservers[i] == NONE) | 881 | if (ic_nameservers[i] == NONE) |
878 | memcpy(&ic_nameservers[i], ext+1+4*i, 4); | 882 | memcpy(&ic_nameservers[i], ext+1+4*i, 4); |
879 | } | 883 | } |
880 | break; | 884 | break; |
881 | case 12: /* Host name */ | 885 | case 12: /* Host name */ |
882 | ic_bootp_string(utsname()->nodename, ext+1, *ext, __NEW_UTS_LEN); | 886 | ic_bootp_string(utsname()->nodename, ext+1, *ext, |
883 | ic_host_name_set = 1; | 887 | __NEW_UTS_LEN); |
884 | break; | 888 | ic_host_name_set = 1; |
885 | case 15: /* Domain name (DNS) */ | 889 | break; |
886 | ic_bootp_string(ic_domain, ext+1, *ext, sizeof(ic_domain)); | 890 | case 15: /* Domain name (DNS) */ |
887 | break; | 891 | ic_bootp_string(ic_domain, ext+1, *ext, sizeof(ic_domain)); |
888 | case 17: /* Root path */ | 892 | break; |
889 | if (!root_server_path[0]) | 893 | case 17: /* Root path */ |
890 | ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path)); | 894 | if (!root_server_path[0]) |
891 | break; | 895 | ic_bootp_string(root_server_path, ext+1, *ext, |
892 | case 26: /* Interface MTU */ | 896 | sizeof(root_server_path)); |
893 | memcpy(&mtu, ext+1, sizeof(mtu)); | 897 | break; |
894 | ic_dev_mtu = ntohs(mtu); | 898 | case 26: /* Interface MTU */ |
895 | break; | 899 | memcpy(&mtu, ext+1, sizeof(mtu)); |
896 | case 40: /* NIS Domain name (_not_ DNS) */ | 900 | ic_dev_mtu = ntohs(mtu); |
897 | ic_bootp_string(utsname()->domainname, ext+1, *ext, __NEW_UTS_LEN); | 901 | break; |
898 | break; | 902 | case 40: /* NIS Domain name (_not_ DNS) */ |
903 | ic_bootp_string(utsname()->domainname, ext+1, *ext, | ||
904 | __NEW_UTS_LEN); | ||
905 | break; | ||
899 | } | 906 | } |
900 | } | 907 | } |
901 | 908 | ||
@@ -932,7 +939,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
932 | goto drop; | 939 | goto drop; |
933 | 940 | ||
934 | /* Fragments are not supported */ | 941 | /* Fragments are not supported */ |
935 | if (h->frag_off & htons(IP_OFFSET | IP_MF)) { | 942 | if (ip_is_fragment(h)) { |
936 | if (net_ratelimit()) | 943 | if (net_ratelimit()) |
937 | printk(KERN_ERR "DHCP/BOOTP: Ignoring fragmented " | 944 | printk(KERN_ERR "DHCP/BOOTP: Ignoring fragmented " |
938 | "reply.\n"); | 945 | "reply.\n"); |