提交 9dd4a13a 编写于 作者: P Philippe De Muyter 提交者: David S. Miller

net/ipv4/ipconfig: really display the BOOTP/DHCP server's address.

Up to now, the debug and info messages from the ipconfig subsytem
claim to display the IP address of the DHCP/BOOTP server but
display instead the IP address of the bootserver.  Fix that.
Signed-off-by: NPhilippe De Muyter <phdm@macqel.be>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3b09adcb
...@@ -136,6 +136,8 @@ __be32 ic_myaddr = NONE; /* My IP address */ ...@@ -136,6 +136,8 @@ __be32 ic_myaddr = NONE; /* My IP address */
static __be32 ic_netmask = NONE; /* Netmask for local subnet */ static __be32 ic_netmask = NONE; /* Netmask for local subnet */
__be32 ic_gateway = NONE; /* Gateway IP address */ __be32 ic_gateway = NONE; /* Gateway IP address */
__be32 ic_addrservaddr = NONE; /* IP Address of the IP addresses'server */
__be32 ic_servaddr = NONE; /* Boot server IP address */ __be32 ic_servaddr = NONE; /* Boot server IP address */
__be32 root_server_addr = NONE; /* Address of NFS server */ __be32 root_server_addr = NONE; /* Address of NFS server */
...@@ -558,6 +560,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt ...@@ -558,6 +560,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if (ic_myaddr == NONE) if (ic_myaddr == NONE)
ic_myaddr = tip; ic_myaddr = tip;
ic_servaddr = sip; ic_servaddr = sip;
ic_addrservaddr = sip;
ic_got_reply = IC_RARP; ic_got_reply = IC_RARP;
drop_unlock: drop_unlock:
...@@ -1068,7 +1071,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str ...@@ -1068,7 +1071,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
ic_servaddr = server_id; ic_servaddr = server_id;
#ifdef IPCONFIG_DEBUG #ifdef IPCONFIG_DEBUG
printk("DHCP: Offered address %pI4 by server %pI4\n", printk("DHCP: Offered address %pI4 by server %pI4\n",
&ic_myaddr, &ic_servaddr); &ic_myaddr, &b->iph.saddr);
#endif #endif
/* The DHCP indicated server address takes /* The DHCP indicated server address takes
* precedence over the bootp header one if * precedence over the bootp header one if
...@@ -1113,6 +1116,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str ...@@ -1113,6 +1116,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
ic_dev = dev; ic_dev = dev;
ic_myaddr = b->your_ip; ic_myaddr = b->your_ip;
ic_servaddr = b->server_ip; ic_servaddr = b->server_ip;
ic_addrservaddr = b->iph.saddr;
if (ic_gateway == NONE && b->relay_ip) if (ic_gateway == NONE && b->relay_ip)
ic_gateway = b->relay_ip; ic_gateway = b->relay_ip;
if (ic_nameservers[0] == NONE) if (ic_nameservers[0] == NONE)
...@@ -1268,7 +1272,7 @@ static int __init ic_dynamic(void) ...@@ -1268,7 +1272,7 @@ static int __init ic_dynamic(void)
printk("IP-Config: Got %s answer from %pI4, ", printk("IP-Config: Got %s answer from %pI4, ",
((ic_got_reply & IC_RARP) ? "RARP" ((ic_got_reply & IC_RARP) ? "RARP"
: (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
&ic_servaddr); &ic_addrservaddr);
pr_cont("my address is %pI4\n", &ic_myaddr); pr_cont("my address is %pI4\n", &ic_myaddr);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册