summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--StdLib/EfiSocketLib/Ip4.c39
-rw-r--r--StdLib/EfiSocketLib/Socket.c2
-rw-r--r--StdLib/EfiSocketLib/Udp4.c39
-rw-r--r--StdLib/EfiSocketLib/Udp6.c39
4 files changed, 70 insertions, 49 deletions
diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c
index a245e68..2e832c7 100644
--- a/StdLib/EfiSocketLib/Ip4.c
+++ b/StdLib/EfiSocketLib/Ip4.c
@@ -985,21 +985,21 @@ EslIp4TxBuffer (
//
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
//
- pIp4 = &pPort->Context.Ip4;
- pTxBytes = &pSocket->TxBytes;
+ pPort = pSocket->pPortList;
+ while ( NULL != pPort ) {
+ //
+ // Determine the queue head
+ //
+ pIp4 = &pPort->Context.Ip4;
- //
- // Verify that there is enough room to buffer another
- // transmit operation
- //
- if ( pSocket->MaxTxBuf > *pTxBytes ) {
//
// Attempt to allocate the packet
//
@@ -1131,6 +1131,7 @@ EslIp4TxBuffer (
// Free the packet
//
EslSocketPacketFree ( pPacket, DEBUG_TX );
+ break;
}
//
@@ -1143,16 +1144,22 @@ EslIp4TxBuffer (
// 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;
+ }
}
//
diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c
index acb2367..e718e9b 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -3191,7 +3191,7 @@ EslSocketPacketFree (
DBG_ENTER ( );
//
- // Allocate a packet structure
+ // Free a packet structure
//
LengthInBytes = pPacket->PacketSize;
Status = gBS->FreePool ( pPacket );
diff --git a/StdLib/EfiSocketLib/Udp4.c b/StdLib/EfiSocketLib/Udp4.c
index 45c0ada..414e3fe 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;
+ }
}
//
diff --git a/StdLib/EfiSocketLib/Udp6.c b/StdLib/EfiSocketLib/Udp6.c
index 899e506..7de5005 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;
+ }
}
//