diff options
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r-- | net/ipv4/ipconfig.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 67e8a6b086ea..1c0e7e051044 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -743,14 +743,22 @@ static void __init ic_bootp_init_ext(u8 *e) | |||
743 | 743 | ||
744 | 744 | ||
745 | /* | 745 | /* |
746 | * Initialize the DHCP/BOOTP mechanism. | 746 | * Predefine Nameservers |
747 | */ | 747 | */ |
748 | static inline void __init ic_bootp_init(void) | 748 | static inline void __init ic_nameservers_predef(void) |
749 | { | 749 | { |
750 | int i; | 750 | int i; |
751 | 751 | ||
752 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) | 752 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) |
753 | ic_nameservers[i] = NONE; | 753 | ic_nameservers[i] = NONE; |
754 | } | ||
755 | |||
756 | /* | ||
757 | * Initialize the DHCP/BOOTP mechanism. | ||
758 | */ | ||
759 | static inline void __init ic_bootp_init(void) | ||
760 | { | ||
761 | ic_nameservers_predef(); | ||
754 | 762 | ||
755 | dev_add_pack(&bootp_packet_type); | 763 | dev_add_pack(&bootp_packet_type); |
756 | } | 764 | } |
@@ -1379,6 +1387,7 @@ static int __init ip_auto_config(void) | |||
1379 | int retries = CONF_OPEN_RETRIES; | 1387 | int retries = CONF_OPEN_RETRIES; |
1380 | #endif | 1388 | #endif |
1381 | int err; | 1389 | int err; |
1390 | unsigned int i; | ||
1382 | 1391 | ||
1383 | #ifdef CONFIG_PROC_FS | 1392 | #ifdef CONFIG_PROC_FS |
1384 | proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops); | 1393 | proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops); |
@@ -1499,7 +1508,15 @@ static int __init ip_auto_config(void) | |||
1499 | &ic_servaddr, &root_server_addr, root_server_path); | 1508 | &ic_servaddr, &root_server_addr, root_server_path); |
1500 | if (ic_dev_mtu) | 1509 | if (ic_dev_mtu) |
1501 | pr_cont(", mtu=%d", ic_dev_mtu); | 1510 | pr_cont(", mtu=%d", ic_dev_mtu); |
1502 | pr_cont("\n"); | 1511 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) |
1512 | if (ic_nameservers[i] != NONE) { | ||
1513 | pr_info(" nameserver%u=%pI4", | ||
1514 | i, &ic_nameservers[i]); | ||
1515 | break; | ||
1516 | } | ||
1517 | for (i++; i < CONF_NAMESERVERS_MAX; i++) | ||
1518 | if (ic_nameservers[i] != NONE) | ||
1519 | pr_cont(", nameserver%u=%pI4\n", i, &ic_nameservers[i]); | ||
1503 | #endif /* !SILENT */ | 1520 | #endif /* !SILENT */ |
1504 | 1521 | ||
1505 | return 0; | 1522 | return 0; |
@@ -1570,6 +1587,8 @@ static int __init ip_auto_config_setup(char *addrs) | |||
1570 | return 1; | 1587 | return 1; |
1571 | } | 1588 | } |
1572 | 1589 | ||
1590 | ic_nameservers_predef(); | ||
1591 | |||
1573 | /* Parse string for static IP assignment. */ | 1592 | /* Parse string for static IP assignment. */ |
1574 | ip = addrs; | 1593 | ip = addrs; |
1575 | while (ip && *ip) { | 1594 | while (ip && *ip) { |
@@ -1613,6 +1632,20 @@ static int __init ip_auto_config_setup(char *addrs) | |||
1613 | ic_enable = 0; | 1632 | ic_enable = 0; |
1614 | } | 1633 | } |
1615 | break; | 1634 | break; |
1635 | case 7: | ||
1636 | if (CONF_NAMESERVERS_MAX >= 1) { | ||
1637 | ic_nameservers[0] = in_aton(ip); | ||
1638 | if (ic_nameservers[0] == ANY) | ||
1639 | ic_nameservers[0] = NONE; | ||
1640 | } | ||
1641 | break; | ||
1642 | case 8: | ||
1643 | if (CONF_NAMESERVERS_MAX >= 2) { | ||
1644 | ic_nameservers[1] = in_aton(ip); | ||
1645 | if (ic_nameservers[1] == ANY) | ||
1646 | ic_nameservers[1] = NONE; | ||
1647 | } | ||
1648 | break; | ||
1616 | } | 1649 | } |
1617 | } | 1650 | } |
1618 | ip = cp; | 1651 | ip = cp; |