mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-16 04:11:22 +00:00
Add proxy dhcp support
This commit is contained in:
parent
bc3b6525d8
commit
5f4fd53641
16
netboot.c
16
netboot.c
@ -257,10 +257,20 @@ static EFI_STATUS parseDhcp4()
|
||||
{
|
||||
CHAR8 *template = (CHAR8 *)translate_slashes(DEFAULT_LOADER_CHAR);
|
||||
INTN template_len = strlen(template) + 1;
|
||||
EFI_PXE_BASE_CODE_DHCPV4_PACKET* pkt_v4 = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *)&pxe->Mode->DhcpAck.Dhcpv4;
|
||||
|
||||
INTN dir_len = strnlena(pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile, 127);
|
||||
if(pxe->Mode->ProxyOfferReceived) {
|
||||
/*
|
||||
* Proxy should not have precedence. Check if DhcpAck
|
||||
* contained boot info.
|
||||
*/
|
||||
if(pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile[0] == '\0')
|
||||
pkt_v4 = &pxe->Mode->ProxyOffer.Dhcpv4;
|
||||
}
|
||||
|
||||
INTN dir_len = strnlena(pkt_v4->BootpBootFile, 127);
|
||||
INTN i;
|
||||
UINT8 *dir = pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile;
|
||||
UINT8 *dir = pkt_v4->BootpBootFile;
|
||||
|
||||
for (i = dir_len; i >= 0; i--) {
|
||||
if (dir[i] == '/')
|
||||
@ -281,7 +291,7 @@ static EFI_STATUS parseDhcp4()
|
||||
if (dir_len == 0 && dir[0] != '/' && template[0] == '/')
|
||||
template++;
|
||||
strcata(full_path, template);
|
||||
memcpy(&tftp_addr.v4, pxe->Mode->DhcpAck.Dhcpv4.BootpSiAddr, 4);
|
||||
memcpy(&tftp_addr.v4, pkt_v4->BootpSiAddr, 4);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user