From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gtc9M-0002Rc-AP for mharc-grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtc9H-0002Q9-LX for grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtc9G-0002i6-NZ for grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:11 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37624 helo=foss.arm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtc9G-0002hE-HW for grub-devel@gnu.org; Tue, 12 Feb 2019 12:47:10 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 67DFF1596; Tue, 12 Feb 2019 09:47:09 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1204B3F675; Tue, 12 Feb 2019 09:47:07 -0800 (PST) From: Andre Przywara To: Daniel Kiper Cc: Vladimir Serbinenko , Andrei Borzenkov , Daniel Kiper , Mark Rutland , grub-devel@gnu.org Subject: [PATCH v2 1/9] net: dhcp: remove dead code Date: Tue, 12 Feb 2019 17:46:52 +0000 Message-Id: <20190212174700.184741-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212174700.184741-1-andre.przywara@arm.com> References: <20190212174700.184741-1-andre.przywara@arm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.140.101.70 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2019 17:47:12 -0000 From: Andrei Borzenkov The comment is right, the "giaddr" fields holds the IP address of the BOOTP relay, not a general purpose router address. Just remove the commented code, archeologists can find it in the git history. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 9e2fdb795..c92dfbd3a 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -161,35 +161,6 @@ grub_net_configure_by_dhcp_ack (const char *name, if (!inter) return 0; -#if 0 - /* This is likely based on misunderstanding. gateway_ip refers to - address of BOOTP relay and should not be used after BOOTP transaction - is complete. - See RFC1542, 3.4 Interpretation of the 'giaddr' field - */ - if (bp->gateway_ip) - { - grub_net_network_level_netaddress_t target; - grub_net_network_level_address_t gw; - char *rname; - - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - target.ipv4.base = bp->server_ip; - target.ipv4.masksize = 32; - gw.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - gw.ipv4 = bp->gateway_ip; - rname = grub_xasprintf ("%s:gw", name); - if (rname) - grub_net_add_route_gw (rname, target, gw); - grub_free (rname); - - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; - target.ipv4.base = bp->gateway_ip; - target.ipv4.masksize = 32; - grub_net_add_route (name, target, inter); - } -#endif - if (size > OFFSET_OF (boot_file, bp)) grub_env_set_net_property (name, "boot_file", bp->boot_file, sizeof (bp->boot_file)); -- 2.17.1