From patchwork Thu Jan 3 18:02:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe De Muyter X-Patchwork-Id: 209291 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 606172C008C for ; Fri, 4 Jan 2013 05:02:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753670Ab3ACSCr (ORCPT ); Thu, 3 Jan 2013 13:02:47 -0500 Received: from smtp2.macqel.be ([194.78.208.39]:27065 "EHLO smtp2.macqel.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753475Ab3ACSCp (ORCPT ); Thu, 3 Jan 2013 13:02:45 -0500 Received: from localhost (localhost [127.0.0.1]) by smtp2.macqel.be (Postfix) with ESMTP id 9CDC8130D7D; Thu, 3 Jan 2013 19:02:42 +0100 (CET) X-Virus-Scanned: amavisd-new at macqel.be Received: from smtp2.macqel.be ([127.0.0.1]) by localhost (mail.macqel.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h70RIEml6O29; Thu, 3 Jan 2013 19:02:40 +0100 (CET) Received: from frolo.macqel.be (frolo.macqel [10.1.40.73]) by smtp2.macqel.be (Postfix) with ESMTP id 5D474130A5E; Thu, 3 Jan 2013 19:02:40 +0100 (CET) Received: by frolo.macqel.be (Postfix, from userid 1000) id 3D6CBDF050E; Thu, 3 Jan 2013 19:02:40 +0100 (CET) From: Philippe De Muyter To: netdev@vger.kernel.org Cc: Philippe De Muyter Subject: [PATCH resent] net/ipv4/ipconfig: really display the BOOTP/DHCP server's address. Date: Thu, 3 Jan 2013 19:02:12 +0100 Message-Id: <1357236132-12574-1-git-send-email-phdm@macqel.be> X-Mailer: git-send-email 1.7.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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: Philippe De Muyter --- net/ipv4/ipconfig.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) PS: I sent exactly(*) the same patch some weeks ago, and only discovered using google, that it was marked as 'Not Applicable' at http://patchwork.ozlabs.org/patch/207970/ I did not receive any mail, or see any post on the list. Is that the normal policy ? * I rebased it, but id did not change, and changed the title and the comment hoping to better explain the bug fixed. diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index d763701..a2e50ae 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -136,6 +136,8 @@ __be32 ic_myaddr = NONE; /* My IP address */ static __be32 ic_netmask = NONE; /* Netmask for local subnet */ __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 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 if (ic_myaddr == NONE) ic_myaddr = tip; ic_servaddr = sip; + ic_addrservaddr = sip; ic_got_reply = IC_RARP; drop_unlock: @@ -1068,7 +1071,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str ic_servaddr = server_id; #ifdef IPCONFIG_DEBUG printk("DHCP: Offered address %pI4 by server %pI4\n", - &ic_myaddr, &ic_servaddr); + &ic_myaddr, &b->iph.saddr); #endif /* The DHCP indicated server address takes * 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 ic_dev = dev; ic_myaddr = b->your_ip; ic_servaddr = b->server_ip; + ic_addrservaddr = b->iph.saddr; if (ic_gateway == NONE && b->relay_ip) ic_gateway = b->relay_ip; if (ic_nameservers[0] == NONE) @@ -1268,7 +1272,7 @@ static int __init ic_dynamic(void) printk("IP-Config: Got %s answer from %pI4, ", ((ic_got_reply & IC_RARP) ? "RARP" : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), - &ic_servaddr); + &ic_addrservaddr); pr_cont("my address is %pI4\n", &ic_myaddr); return 0;