Revision: 13713
http://edk2.svn.sourceforge.net/edk2/?rev=13713&view=rev
Author: lpleahy
Date: 2012-09-10 19:04:41 +0000 (Mon, 10 Sep 2012)
Log Message:
-----------
Modify UDP and IP to transmit on all network adapters instead of just the first
network adapter.
Fix comment in Socket.c.
Signed-off-by: lpleahy
Reviewed and tested by: Sreenivasula Reddy of Dell
Modified Paths:
--------------
trunk/edk2/StdLib/EfiSocketLib/Ip4.c
trunk/edk2/StdLib/EfiSocketLib/Socket.c
trunk/edk2/StdLib/EfiSocketLib/Udp4.c
trunk/edk2/StdLib/EfiSocketLib/Udp6.c
Modified: trunk/edk2/StdLib/EfiSocketLib/Ip4.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Ip4.c 2012-09-10 09:35:43 UTC (rev
13712)
+++ trunk/edk2/StdLib/EfiSocketLib/Ip4.c 2012-09-10 19:04:41 UTC (rev
13713)
@@ -985,21 +985,21 @@
//
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 @@
// Free the packet
//
EslSocketPacketFree ( pPacket, DEBUG_TX );
+ break;
}
//
@@ -1143,16 +1144,22 @@
// 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;
+ }
}
//
Modified: trunk/edk2/StdLib/EfiSocketLib/Socket.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Socket.c 2012-09-10 09:35:43 UTC (rev
13712)
+++ trunk/edk2/StdLib/EfiSocketLib/Socket.c 2012-09-10 19:04:41 UTC (rev
13713)
@@ -3191,7 +3191,7 @@
DBG_ENTER ( );
//
- // Allocate a packet structure
+ // Free a packet structure
//
LengthInBytes = pPacket->PacketSize;
Status = gBS->FreePool ( pPacket );
Modified: trunk/edk2/StdLib/EfiSocketLib/Udp4.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Udp4.c 2012-09-10 09:35:43 UTC (rev
13712)
+++ trunk/edk2/StdLib/EfiSocketLib/Udp4.c 2012-09-10 19:04:41 UTC (rev
13713)
@@ -794,21 +794,21 @@
//
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 @@
// Free the packet
//
EslSocketPacketFree ( pPacket, DEBUG_TX );
+ break;
}
//
@@ -935,16 +936,22 @@
// 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;
+ }
}
//
Modified: trunk/edk2/StdLib/EfiSocketLib/Udp6.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Udp6.c 2012-09-10 09:35:43 UTC (rev
13712)
+++ trunk/edk2/StdLib/EfiSocketLib/Udp6.c 2012-09-10 19:04:41 UTC (rev
13713)
@@ -835,21 +835,21 @@
//
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 @@
// Free the packet
//
EslSocketPacketFree ( pPacket, DEBUG_TX );
+ break;
}
//
@@ -972,16 +973,22 @@
// 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;
+ }
}
//
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits