diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ipconfig.c | 73 |
1 files changed, 38 insertions, 35 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index ae93dd5ef401..472a8c4f1dc0 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -861,41 +861,44 @@ static void __init ic_do_bootp_ext(u8 *ext) | |||
861 | #endif | 861 | #endif |
862 | 862 | ||
863 | switch (*ext++) { | 863 | switch (*ext++) { |
864 | case 1: /* Subnet mask */ | 864 | case 1: /* Subnet mask */ |
865 | if (ic_netmask == NONE) | 865 | if (ic_netmask == NONE) |
866 | memcpy(&ic_netmask, ext+1, 4); | 866 | memcpy(&ic_netmask, ext+1, 4); |
867 | break; | 867 | break; |
868 | case 3: /* Default gateway */ | 868 | case 3: /* Default gateway */ |
869 | if (ic_gateway == NONE) | 869 | if (ic_gateway == NONE) |
870 | memcpy(&ic_gateway, ext+1, 4); | 870 | memcpy(&ic_gateway, ext+1, 4); |
871 | break; | 871 | break; |
872 | case 6: /* DNS server */ | 872 | case 6: /* DNS server */ |
873 | servers= *ext/4; | 873 | servers= *ext/4; |
874 | if (servers > CONF_NAMESERVERS_MAX) | 874 | if (servers > CONF_NAMESERVERS_MAX) |
875 | servers = CONF_NAMESERVERS_MAX; | 875 | servers = CONF_NAMESERVERS_MAX; |
876 | for (i = 0; i < servers; i++) { | 876 | for (i = 0; i < servers; i++) { |
877 | if (ic_nameservers[i] == NONE) | 877 | if (ic_nameservers[i] == NONE) |
878 | memcpy(&ic_nameservers[i], ext+1+4*i, 4); | 878 | memcpy(&ic_nameservers[i], ext+1+4*i, 4); |
879 | } | 879 | } |
880 | break; | 880 | break; |
881 | case 12: /* Host name */ | 881 | case 12: /* Host name */ |
882 | ic_bootp_string(utsname()->nodename, ext+1, *ext, __NEW_UTS_LEN); | 882 | ic_bootp_string(utsname()->nodename, ext+1, *ext, |
883 | ic_host_name_set = 1; | 883 | __NEW_UTS_LEN); |
884 | break; | 884 | ic_host_name_set = 1; |
885 | case 15: /* Domain name (DNS) */ | 885 | break; |
886 | ic_bootp_string(ic_domain, ext+1, *ext, sizeof(ic_domain)); | 886 | case 15: /* Domain name (DNS) */ |
887 | break; | 887 | ic_bootp_string(ic_domain, ext+1, *ext, sizeof(ic_domain)); |
888 | case 17: /* Root path */ | 888 | break; |
889 | if (!root_server_path[0]) | 889 | case 17: /* Root path */ |
890 | ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path)); | 890 | if (!root_server_path[0]) |
891 | break; | 891 | ic_bootp_string(root_server_path, ext+1, *ext, |
892 | case 26: /* Interface MTU */ | 892 | sizeof(root_server_path)); |
893 | memcpy(&mtu, ext+1, sizeof(mtu)); | 893 | break; |
894 | ic_dev_mtu = ntohs(mtu); | 894 | case 26: /* Interface MTU */ |
895 | break; | 895 | memcpy(&mtu, ext+1, sizeof(mtu)); |
896 | case 40: /* NIS Domain name (_not_ DNS) */ | 896 | ic_dev_mtu = ntohs(mtu); |
897 | ic_bootp_string(utsname()->domainname, ext+1, *ext, __NEW_UTS_LEN); | 897 | break; |
898 | break; | 898 | case 40: /* NIS Domain name (_not_ DNS) */ |
899 | ic_bootp_string(utsname()->domainname, ext+1, *ext, | ||
900 | __NEW_UTS_LEN); | ||
901 | break; | ||
899 | } | 902 | } |
900 | } | 903 | } |
901 | 904 | ||