[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/9] net: dhcp: remove dead code
From: |
Andre Przywara |
Subject: |
[PATCH v2 1/9] net: dhcp: remove dead code |
Date: |
Tue, 12 Feb 2019 17:46:52 +0000 |
From: Andrei Borzenkov <address@hidden>
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 <address@hidden>
---
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
- [PATCH v2 0/9] net: bootp: add native DHCPv4 support, Andre Przywara, 2019/02/12
- [PATCH v2 1/9] net: dhcp: remove dead code,
Andre Przywara <=
- [PATCH v2 2/9] net: dhcp: replace parse_dhcp_vendor() with find_dhcp_option(), Andre Przywara, 2019/02/12
- [PATCH v2 3/9] net: dhcp: refactor DHCP packet transmission into separate function, Andre Przywara, 2019/02/12
- [PATCH v2 4/9] net: dhcp: make grub_net_process_dhcp take an interface, Andre Przywara, 2019/02/12
- [PATCH v2 5/9] net: dhcp: introduce per-interface timeout, Andre Przywara, 2019/02/12
- [PATCH v2 6/9] net: dhcp: use DHCP options for name and bootfile, Andre Przywara, 2019/02/12