[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 20/20] efinet: Add DHCP proxy support
From: |
Robbie Harwood |
Subject: |
[PATCH v5 20/20] efinet: Add DHCP proxy support |
Date: |
Tue, 25 Apr 2023 11:05:31 -0400 |
From: Ian Page Hands <iphands@gmail.com>
If a proxyDHCP configuration is used, the server name, server IP and
boot file values should be taken from the DHCP proxy offer instead of
the DHCP server ack packet.
Signed-off-by: Ian Page Hands <iphands@gmail.com>
Co-authored-by: Robbie Harwood <rharwood@redhat.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
grub-core/net/drivers/efi/efinet.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/grub-core/net/drivers/efi/efinet.c
b/grub-core/net/drivers/efi/efinet.c
index d4ae865b6f..fc8d7ef196 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -863,10 +863,33 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char
**device,
else
{
grub_dprintf ("efinet", "using ipv4 and dhcp\n");
+
+ struct grub_net_bootp_packet *dhcp_ack = (void *) &pxe_mode->dhcp_ack;
+
+ if (pxe_mode->proxy_offer_received)
+ {
+ grub_dprintf ("efinet", "proxy offer receive");
+ struct grub_net_bootp_packet *proxy_offer = (void *)
&pxe_mode->proxy_offer;
+
+ if (proxy_offer && dhcp_ack->boot_file[0] == '\0')
+ {
+ grub_dprintf ("efinet", "setting values from proxy offer");
+ /*
+ * Here we got a proxy offer and the dhcp_ack has a nil
+ * boot_file Copy the proxy DHCP offer details into the
+ * bootp_packet we are sending forward as they are the deatils
+ * we need.
+ */
+ *dhcp_ack->server_name = *proxy_offer->server_name;
+ *dhcp_ack->boot_file = *proxy_offer->boot_file;
+ dhcp_ack->server_ip = proxy_offer->server_ip;
+ }
+ }
+
inter = grub_net_configure_by_dhcp_ack (card->name, card, 0,
(struct grub_net_bootp_packet
*)
- packet_buf,
- packet_bufsz,
+ &pxe_mode->dhcp_ack,
+ sizeof (pxe_mode->dhcp_ack),
1, device, path);
grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path);
}
--
2.40.0
- [PATCH v5 01/20] Revert "net/http: Allow use of non-standard TCP/IP ports", (continued)
- [PATCH v5 01/20] Revert "net/http: Allow use of non-standard TCP/IP ports", Robbie Harwood, 2023/04/25
- [PATCH v5 13/20] Add fw_path variable to detect config file on efi, Robbie Harwood, 2023/04/25
- [PATCH v5 19/20] normal/main: Discover the device to read the config from as a fallback, Robbie Harwood, 2023/04/25
- [PATCH v5 10/20] Support UEFI networking protocols, Robbie Harwood, 2023/04/25
- [PATCH v5 03/20] net/http: check result of grub_netbuff_put() in http_receive(), Robbie Harwood, 2023/04/25
- [PATCH v5 16/20] Prepend prefix when HTTP path is relative, Robbie Harwood, 2023/04/25
- [PATCH v5 11/20] efinet: also use the firmware acceleration for http, Robbie Harwood, 2023/04/25
- [PATCH v5 08/20] efinet Configure network from UEFI device path, Robbie Harwood, 2023/04/25
- [PATCH v5 06/20] grub.texi: Add net_bootp6 doumentation, Robbie Harwood, 2023/04/25
- [PATCH v5 15/20] Try mac/guid/etc before grub.cfg on tftp config files, Robbie Harwood, 2023/04/25
- [PATCH v5 20/20] efinet: Add DHCP proxy support,
Robbie Harwood <=
- [PATCH v5 05/20] efinet: add structures for PXE messages, Robbie Harwood, 2023/04/25
- [PATCH v5 18/20] http: Prepend prefix when the HTTP path is relative, Robbie Harwood, 2023/04/25
- [PATCH v5 07/20] bootp: Process DHCPACK packet during HTTP Boot, Robbie Harwood, 2023/04/25
- [PATCH v5 09/20] efinet: set DNS server from UEFI protocol, Robbie Harwood, 2023/04/25
- [PATCH v5 02/20] net: read bracketed ipv6 addrs and port numbers, Robbie Harwood, 2023/04/25
- [PATCH v5 17/20] efi/http: Enclose literal IPv6 addresses in square brackets, Robbie Harwood, 2023/04/25
- [PATCH v5 12/20] efi/http: match protocol+hostname of boot url in root_url, Robbie Harwood, 2023/04/25
- [PATCH v5 14/20] use fw_path prefix when fallback searching for grub config, Robbie Harwood, 2023/04/25