static size_t *receive_lengths;
static int rx_packet_idx;
static int rx_packet_num;
+static struct efi_net_obj *netobj;
/*
* The notification function of this event is called in every timer cycle
{
int maxsize = sizeof(*dhcp_ack);
- if (!dhcp_ack)
+ if (!dhcp_ack) {
dhcp_ack = malloc(maxsize);
-
+ if (!dhcp_ack)
+ return;
+ }
+ memset(dhcp_ack, 0, maxsize);
memcpy(dhcp_ack, pkt, min(len, maxsize));
+
+ if (netobj)
+ netobj->pxe_mode.dhcp_ack = *dhcp_ack;
}
/**
*/
efi_status_t efi_net_register(void)
{
- struct efi_net_obj *netobj = NULL;
efi_status_t r;
int i;
return r;
out_of_resources:
free(netobj);
+ netobj = NULL;
free(transmit_buffer);
if (receive_buffer)
for (i = 0; i < ETH_PACKETS_BATCH_RECV; i++)