X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=StdLib%2FEfiSocketLib%2FUdp6.c;h=7de5005096477ea71ed023d033218d87f3ff3365;hp=899e50681eeee8b5d94e54ae5cea66ebdfc0ca3d;hb=884ed923564f35084c45a8f3f132c076b26f2423;hpb=44890dbde6b2a70348787d81885012583ed4a5dd diff --git a/StdLib/EfiSocketLib/Udp6.c b/StdLib/EfiSocketLib/Udp6.c index 899e50681e..7de5005096 100644 --- a/StdLib/EfiSocketLib/Udp6.c +++ b/StdLib/EfiSocketLib/Udp6.c @@ -835,21 +835,21 @@ EslUdp6TxBuffer ( // if ( SOCKET_STATE_CONNECTED == pSocket->State ) { // - // Locate the port + // Verify that there is enough room to buffer another + // transmit operation // - pPort = pSocket->pPortList; - if ( NULL != pPort ) { + pTxBytes = &pSocket->TxBytes; + if ( pSocket->MaxTxBuf > *pTxBytes ) { // - // Determine the queue head + // Locate the port // - pUdp6 = &pPort->Context.Udp6; - pTxBytes = &pSocket->TxBytes; + pPort = pSocket->pPortList; + while ( NULL != pPort ) { + // + // Determine the queue head + // + pUdp6 = &pPort->Context.Udp6; - // - // Verify that there is enough room to buffer another - // transmit operation - // - if ( pSocket->MaxTxBuf > *pTxBytes ) { // // Attempt to allocate the packet // @@ -960,6 +960,7 @@ EslUdp6TxBuffer ( // Free the packet // EslSocketPacketFree ( pPacket, DEBUG_TX ); + break; } // @@ -972,16 +973,22 @@ EslUdp6TxBuffer ( // Packet allocation failed // pSocket->errno = ENOMEM; + break; } - } - else { + // - // Not enough buffer space available + // Set the next port // - pSocket->errno = EAGAIN; - Status = EFI_NOT_READY; + pPort = pPort->pLinkSocket; } } + else { + // + // Not enough buffer space available + // + pSocket->errno = EAGAIN; + Status = EFI_NOT_READY; + } } //