Skip to content

Commit

Permalink
efi/udp: Add retry disabling UseDefaultAddress
Browse files Browse the repository at this point in the history
Add retry disabling UseDefaultAddress in core_udp_connect() and
core_udp_sendto()

Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
  • Loading branch information
JulienVdG authored and geneC committed May 31, 2017
1 parent 8a0d484 commit 828a75d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions efi/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ void core_udp_connect(struct pxe_pvt_inode *socket, uint32_t ip,
/* Re-use the existing local port number */
udata.StationPort = socket->net.efi.localport;

retry:
if (efi_net_def_addr) {
udata.UseDefaultAddress = TRUE;
} else {
Expand All @@ -170,6 +171,11 @@ void core_udp_connect(struct pxe_pvt_inode *socket, uint32_t ip,
udata.TimeToLive = 64;

status = core_udp_configure(udp, &udata, L"core_udp_connect");
if (efi_net_def_addr && (status == EFI_NO_MAPPING)) {
efi_net_def_addr = 0;
Print(L"disable UseDefaultAddress\n");
goto retry;
}
if (status != EFI_SUCCESS) {
Print(L"Failed to configure UDP: %d\n", status);
return;
Expand Down Expand Up @@ -392,6 +398,7 @@ void core_udp_sendto(struct pxe_pvt_inode *socket, const void *data,
/* Re-use the existing local port number */
udata.StationPort = socket->net.efi.localport;

retry:
if (efi_net_def_addr) {
udata.UseDefaultAddress = TRUE;
} else {
Expand All @@ -404,6 +411,11 @@ void core_udp_sendto(struct pxe_pvt_inode *socket, const void *data,
udata.TimeToLive = 64;

status = core_udp_configure(udp, &udata, L"core_udp_sendto");
if (efi_net_def_addr && (status == EFI_NO_MAPPING)) {
efi_net_def_addr = 0;
Print(L"disable UseDefaultAddress\n");
goto retry;
}
if (status != EFI_SUCCESS)
goto bail;

Expand Down

0 comments on commit 828a75d

Please sign in to comment.