// Set the port number\r
//\r
pConfig->StationPort = SwapBytes16 ( pIpAddress->sin6_port );\r
+ pPort->pSocket->bAddressSet = TRUE;\r
\r
//\r
// Display the local address\r
//\r
// Fill in the port list if necessary\r
//\r
+ pSocket->errno = ENETDOWN;\r
if ( NULL == pSocket->pPortList ) {\r
ZeroMem ( &LocalAddress, sizeof ( LocalAddress ));\r
LocalAddress.sin6_len = sizeof ( LocalAddress );\r
NULL );\r
}\r
if ( EFI_ERROR ( Status )) {\r
- DEBUG (( DEBUG_LISTEN,\r
- "ERROR - Failed to configure the Udp6 port, Status: %r\r\n",\r
- Status ));\r
- switch ( Status ) {\r
- case EFI_ACCESS_DENIED:\r
- pSocket->errno = EACCES;\r
- break;\r
+ if ( !pSocket->bConfigured ) {\r
+ DEBUG (( DEBUG_LISTEN,\r
+ "ERROR - Failed to configure the Udp6 port, Status: %r\r\n",\r
+ Status ));\r
+ switch ( Status ) {\r
+ case EFI_ACCESS_DENIED:\r
+ pSocket->errno = EACCES;\r
+ break;\r
+\r
+ default:\r
+ case EFI_DEVICE_ERROR:\r
+ pSocket->errno = EIO;\r
+ break;\r
\r
- default:\r
- case EFI_DEVICE_ERROR:\r
- pSocket->errno = EIO;\r
- break;\r
+ case EFI_INVALID_PARAMETER:\r
+ pSocket->errno = EADDRNOTAVAIL;\r
+ break;\r
\r
- case EFI_INVALID_PARAMETER:\r
- pSocket->errno = EADDRNOTAVAIL;\r
- break;\r
+ case EFI_NO_MAPPING:\r
+ pSocket->errno = EAFNOSUPPORT;\r
+ break;\r
\r
- case EFI_NO_MAPPING:\r
- pSocket->errno = EAFNOSUPPORT;\r
- break;\r
-\r
- case EFI_OUT_OF_RESOURCES:\r
- pSocket->errno = ENOBUFS;\r
- break;\r
+ case EFI_OUT_OF_RESOURCES:\r
+ pSocket->errno = ENOBUFS;\r
+ break;\r
\r
- case EFI_UNSUPPORTED:\r
- pSocket->errno = EOPNOTSUPP;\r
- break;\r
+ case EFI_UNSUPPORTED:\r
+ pSocket->errno = EOPNOTSUPP;\r
+ break;\r
+ }\r
}\r
}\r
else {\r
pConfigData->RemoteAddress.Addr[15],\r
pConfigData->RemotePort ));\r
pPort->bConfigured = TRUE;\r
+ pSocket->bConfigured = TRUE;\r
\r
//\r
// Start the first read on the port\r
// The socket is connected\r
//\r
pSocket->State = SOCKET_STATE_CONNECTED;\r
+ pSocket->errno = 0;\r
}\r
\r
//\r
//\r
pPort = pNextPort;\r
}\r
-\r
- //\r
- // Determine the configuration status\r
- //\r
- if ( NULL != pSocket->pPortList ) {\r
- pSocket->bConfigured = TRUE;\r
- }\r
}\r
\r
//\r
// Determine the socket configuration status\r
//\r
- if ( !EFI_ERROR ( Status )) {\r
- Status = pSocket->bConfigured ? EFI_SUCCESS : EFI_NOT_STARTED;\r
- }\r
+ Status = pSocket->bConfigured ? EFI_SUCCESS : EFI_NOT_STARTED;\r
\r
//\r
// Return the port connected state.\r
//\r
if ( SOCKET_STATE_CONNECTED == pSocket->State ) {\r
//\r
- // Locate the port\r
+ // Verify that there is enough room to buffer another\r
+ // transmit operation\r
//\r
- pPort = pSocket->pPortList;\r
- if ( NULL != pPort ) {\r
+ pTxBytes = &pSocket->TxBytes;\r
+ if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
//\r
- // Determine the queue head\r
+ // Locate the port\r
//\r
- pUdp6 = &pPort->Context.Udp6;\r
- pTxBytes = &pSocket->TxBytes;\r
+ pPort = pSocket->pPortList;\r
+ while ( NULL != pPort ) {\r
+ //\r
+ // Determine the queue head\r
+ //\r
+ pUdp6 = &pPort->Context.Udp6;\r
\r
- //\r
- // Verify that there is enough room to buffer another\r
- // transmit operation\r
- //\r
- if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
//\r
// Attempt to allocate the packet\r
//\r
// Free the packet\r
//\r
EslSocketPacketFree ( pPacket, DEBUG_TX );\r
+ break;\r
}\r
\r
//\r
// Packet allocation failed\r
//\r
pSocket->errno = ENOMEM;\r
+ break;\r
}\r
- }\r
- else {\r
+\r
//\r
- // Not enough buffer space available\r
+ // Set the next port\r
//\r
- pSocket->errno = EAGAIN;\r
- Status = EFI_NOT_READY;\r
+ pPort = pPort->pLinkSocket;\r
}\r
}\r
+ else {\r
+ //\r
+ // Not enough buffer space available\r
+ //\r
+ pSocket->errno = EAGAIN;\r
+ Status = EFI_NOT_READY;\r
+ }\r
}\r
\r
//\r