Return the proper status after one of the ports is configured for UDP or IP communications.

Reviewed by: Ankit Singh of Dell
Submitted by: lpleahy


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13604 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lpleahy 2012-08-10 01:13:05 +00:00
parent 36384ceb64
commit bb3aa953b3
3 changed files with 87 additions and 99 deletions

View File

@ -749,6 +749,7 @@ EslIp4RxComplete (
//
// Fill in the port list if necessary
//
pSocket->errno = ENETDOWN;
if ( NULL == pSocket->pPortList ) {
LocalAddress.sin_len = sizeof ( LocalAddress );
LocalAddress.sin_family = AF_INET;
@ -804,6 +805,7 @@ EslIp4RxComplete (
NULL );
}
if ( EFI_ERROR ( Status )) {
if ( !pSocket->bConfigured ) {
DEBUG (( DEBUG_LISTEN,
"ERROR - Failed to configure the Ip4 port, Status: %r\r\n",
Status ));
@ -834,6 +836,7 @@ EslIp4RxComplete (
break;
}
}
}
else {
DEBUG (( DEBUG_TX,
"0x%08x: pPort Configured for %d.%d.%d.%d --> %d.%d.%d.%d\r\n",
@ -876,6 +879,7 @@ EslIp4RxComplete (
pIp4->ModeData.RouteTable[Index].GatewayAddress.Addr[3]));
}
pPort->bConfigured = TRUE;
pSocket->bConfigured = TRUE;
//
// Start the first read on the port
@ -886,6 +890,7 @@ EslIp4RxComplete (
// The socket is connected
//
pSocket->State = SOCKET_STATE_CONNECTED;
pSocket->errno = 0;
}
//
@ -893,21 +898,12 @@ EslIp4RxComplete (
//
pPort = pNextPort;
}
//
// Determine the configuration status
//
if ( NULL != pSocket->pPortList ) {
pSocket->bConfigured = TRUE;
}
}
//
// Determine the socket configuration status
//
if ( !EFI_ERROR ( Status )) {
Status = pSocket->bConfigured ? EFI_SUCCESS : EFI_NOT_STARTED;
}
//
// Return the port connected state.

View File

@ -591,6 +591,7 @@ EslUdp4RxComplete (
//
// Fill in the port list if necessary
//
pSocket->errno = ENETDOWN;
if ( NULL == pSocket->pPortList ) {
LocalAddress.sin_len = sizeof ( LocalAddress );
LocalAddress.sin_family = AF_INET;
@ -640,6 +641,7 @@ EslUdp4RxComplete (
NULL );
}
if ( EFI_ERROR ( Status )) {
if ( !pSocket->bConfigured ) {
DEBUG (( DEBUG_LISTEN,
"ERROR - Failed to configure the Udp4 port, Status: %r\r\n",
Status ));
@ -670,6 +672,7 @@ EslUdp4RxComplete (
break;
}
}
}
else {
DEBUG (( DEBUG_TX,
"0x%08x: pPort Configured for %d.%d.%d.%d:%d --> %d.%d.%d.%d:%d\r\n",
@ -685,6 +688,7 @@ EslUdp4RxComplete (
pConfigData->RemoteAddress.Addr[3],
pConfigData->RemotePort ));
pPort->bConfigured = TRUE;
pSocket->bConfigured = TRUE;
//
// Start the first read on the port
@ -695,6 +699,7 @@ EslUdp4RxComplete (
// The socket is connected
//
pSocket->State = SOCKET_STATE_CONNECTED;
pSocket->errno = 0;
}
//
@ -702,21 +707,12 @@ EslUdp4RxComplete (
//
pPort = pNextPort;
}
//
// Determine the configuration status
//
if ( NULL != pSocket->pPortList ) {
pSocket->bConfigured = TRUE;
}
}
//
// Determine the socket configuration status
//
if ( !EFI_ERROR ( Status )) {
Status = pSocket->bConfigured ? EFI_SUCCESS : EFI_NOT_STARTED;
}
//
// Return the port connected state.

View File

@ -585,6 +585,7 @@ EslUdp6RxComplete (
//
// Fill in the port list if necessary
//
pSocket->errno = ENETDOWN;
if ( NULL == pSocket->pPortList ) {
ZeroMem ( &LocalAddress, sizeof ( LocalAddress ));
LocalAddress.sin6_len = sizeof ( LocalAddress );
@ -657,6 +658,7 @@ EslUdp6RxComplete (
NULL );
}
if ( EFI_ERROR ( Status )) {
if ( !pSocket->bConfigured ) {
DEBUG (( DEBUG_LISTEN,
"ERROR - Failed to configure the Udp6 port, Status: %r\r\n",
Status ));
@ -687,6 +689,7 @@ EslUdp6RxComplete (
break;
}
}
}
else {
DEBUG (( DEBUG_TX,
"0x%08x: pPort Configured for [%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%d --> [%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]:%d\r\n",
@ -726,6 +729,7 @@ EslUdp6RxComplete (
pConfigData->RemoteAddress.Addr[15],
pConfigData->RemotePort ));
pPort->bConfigured = TRUE;
pSocket->bConfigured = TRUE;
//
// Start the first read on the port
@ -736,6 +740,7 @@ EslUdp6RxComplete (
// The socket is connected
//
pSocket->State = SOCKET_STATE_CONNECTED;
pSocket->errno = 0;
}
//
@ -743,21 +748,12 @@ EslUdp6RxComplete (
//
pPort = pNextPort;
}
//
// Determine the configuration status
//
if ( NULL != pSocket->pPortList ) {
pSocket->bConfigured = TRUE;
}
}
//
// Determine the socket configuration status
//
if ( !EFI_ERROR ( Status )) {
Status = pSocket->bConfigured ? EFI_SUCCESS : EFI_NOT_STARTED;
}
//
// Return the port connected state.