[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFC Patch [2/2] PXE Add support for proxy DHCP -- EFI Code
From: |
Mroczek, Joseph T |
Subject: |
RFC Patch [2/2] PXE Add support for proxy DHCP -- EFI Code |
Date: |
Sat, 19 Apr 2014 00:34:27 +0000 |
Sorry about the HTML in previous message.
Hello:
Here is the uEFI specific portion. I have tested it on three different
platforms without issue.
~joe
diff -Naur grub-2.02~beta2/grub-core/net/drivers/efi/efinet.c
grub-2.02~beta2-jtm-clean/grub-core/net/drivers/efi/efinet.c
--- grub-2.02~beta2/grub-core/net/drivers/efi/efinet.c 2013-12-24
11:29:27.000000000 -0500
+++ grub-2.02~beta2-jtm-clean/grub-core/net/drivers/efi/efinet.c
2014-04-18 19:26:44.862208600 -0400
@@ -223,6 +223,7 @@
{
struct grub_net_card *card;
grub_efi_device_path_t *dp;
+ struct grub_net_bootp_packet *combined_bootp = NULL;
dp = grub_efi_get_device_path (hnd);
if (! dp)
@@ -245,11 +246,22 @@
if (! pxe)
continue;
pxe_mode = pxe->mode;
- grub_net_configure_by_dhcp_ack (card->name, card, 0,
- (struct
grub_net_bootp_packet *)
-
&pxe_mode->dhcp_ack,
- sizeof
(pxe_mode->dhcp_ack),
- 1, device,
path);
+ if (pxe_mode->proxy_offer_received)
+ {
+ combined_bootp = grub_zalloc (sizeof (*combined_bootp));
+ grub_net_merge_dhcp_ack (combined_bootp, (struct grub_net_bootp_packet
*) pxe_mode->proxy_offer);
+ grub_net_merge_dhcp_ack (combined_bootp, (struct grub_net_bootp_packet
*) pxe_mode->dhcp_ack);
+ grub_net_configure_by_dhcp_ack (card->name, card, 0,
+ combined_bootp,
+ sizeof
(combined_bootp),
+
1, device, path);
+ }
+ else
+ grub_net_configure_by_dhcp_ack (card->name, card, 0,
+ (struct
grub_net_bootp_packet *)
+
&pxe_mode->dhcp_ack,
+ sizeof
(pxe_mode->dhcp_ack),
+ 1, device,
path);
return;
}
}
diff -Naur grub-2.02~beta2/include/grub/efi/api.h
grub-2.02~beta2-jtm-clean/include/grub/efi/api.h
--- grub-2.02~beta2/include/grub/efi/api.h 2013-12-24
12:04:54.000000000 -0500
+++ grub-2.02~beta2-jtm-clean/include/grub/efi/api.h 2014-04-18
19:26:44.866208600 -0400
@@ -526,7 +526,7 @@
typedef grub_uint8_t grub_efi_mac_address_t[32];
typedef grub_uint8_t grub_efi_ipv4_address_t[4];
typedef grub_uint16_t grub_efi_ipv6_address_t[8];
-typedef grub_uint8_t grub_efi_ip_address_t[8] __attribute__ ((aligned(4)));
+typedef grub_uint8_t grub_efi_ip_address_t[16] __attribute__ ((aligned(4)));
typedef grub_efi_uint64_t grub_efi_physical_address_t;
typedef grub_efi_uint64_t grub_efi_virtual_address_t;
@@ -1342,12 +1342,33 @@
typedef struct grub_efi_pxe_mode
{
- grub_uint8_t unused[52];
+ grub_uint8_t started;
+ grub_uint8_t ipv6_available;
+ grub_uint8_t ipv6_supported;
+ grub_uint8_t using_ipv6;
+ grub_uint8_t bis_supported;
+ grub_uint8_t bis_detected;
+ grub_uint8_t auto_arp;
+ grub_uint8_t send_guid;
+ grub_uint8_t dhcp_discover_valid;
+ grub_uint8_t dhcp_ack_received;
+ grub_uint8_t proxy_offer_received;
+ grub_uint8_t pxe_discover_valid;
+ grub_uint8_t pxe_reply_received;
+ grub_uint8_t pxe_bis_reply_received;
+ grub_uint8_t icmp_error_received;
+ grub_uint8_t tftp_error_received;
+ grub_uint8_t make_callbacks;
+ grub_uint8_t ttl;
+ grub_uint8_t tos;
+ grub_efi_ip_address_t station_ip;
+ grub_efi_ip_address_t subnet_mask;
grub_efi_pxe_packet_t dhcp_discover;
grub_efi_pxe_packet_t dhcp_ack;
grub_efi_pxe_packet_t proxy_offer;
grub_efi_pxe_packet_t pxe_discover;
grub_efi_pxe_packet_t pxe_reply;
+ grub_efi_pxe_packet_t pxe_bis_reply;
} grub_efi_pxe_mode_t;
typedef struct grub_efi_pxe