summaryrefslogtreecommitdiff
path: root/StdLib/EfiSocketLib/Udp4.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/EfiSocketLib/Udp4.c')
-rw-r--r--StdLib/EfiSocketLib/Udp4.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/StdLib/EfiSocketLib/Udp4.c b/StdLib/EfiSocketLib/Udp4.c
index 45c0adad3a..414e3fe321 100644
--- a/StdLib/EfiSocketLib/Udp4.c
+++ b/StdLib/EfiSocketLib/Udp4.c
@@ -794,21 +794,21 @@ EslUdp4TxBuffer (
//
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
//
- pUdp4 = &pPort->Context.Udp4;
- pTxBytes = &pSocket->TxBytes;
+ pPort = pSocket->pPortList;
+ while ( NULL != pPort ) {
+ //
+ // Determine the queue head
+ //
+ pUdp4 = &pPort->Context.Udp4;
- //
- // Verify that there is enough room to buffer another
- // transmit operation
- //
- if ( pSocket->MaxTxBuf > *pTxBytes ) {
//
// Attempt to allocate the packet
//
@@ -923,6 +923,7 @@ EslUdp4TxBuffer (
// Free the packet
//
EslSocketPacketFree ( pPacket, DEBUG_TX );
+ break;
}
//
@@ -935,16 +936,22 @@ EslUdp4TxBuffer (
// 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;
+ }
}
//