static void AL_API\r
cm_rej_callback(IN ib_cm_rej_rec_t *p_cm_rej_rec )\r
{\r
- SDP_PRINT(SDP_TRACE, SDP_SOCKET, ("dispatch level = %d\n", KeGetCurrentIrql()));\r
+ SDP_PRINT(SDP_ERR, SDP_SOCKET, ("dispatch level = %d\n", KeGetCurrentIrql()));\r
// BUGBUG: This should be used to return error to the connecting side\r
}\r
\r
WspSendOut *pWspSendOut\r
)\r
{ \r
- SDP_PRINT(SDP_DEBUG, SDP_SOCKET, ("this = 0x%p \n",this));\r
+ SDP_PRINT(SDP_DEBUG, SDP_SOCKET, ("this = 0x%p size = %d \n",this, pWspSendIn->BufferSize));\r
\r
NTSTATUS rc = STATUS_SUCCESS; \r
NTSTATUS rc1; // used only to check that there are no more errors on the \r
ib_gid_t DestPortGid;\r
\r
ib_path_rec_t path_rec;\r
+ ULONG SrcIp = 0;\r
\r
SDP_PRINT(SDP_TRACE, SDP_SOCKET, ("this = 0x%p remote addresses ip=%d.%d.%d.%d:%d\n",\r
this,\r
// No explicit bind was done, we use the default addresses\r
m_SrcIp = pWspConnectIn->SrcIP;\r
}\r
+ if (m_SrcIp == INADDR_LOOPBACK) {\r
+ // This is the loopback case, we use the dest IP in order to\r
+ // get the port\r
+ SrcIp = pWspConnectIn->DestIP;\r
+ } else {\r
+ SrcIp = m_SrcIp;\r
+ }\r
\r
// Now that we know the source IP we can decide about the src port\r
if (m_SrcPort == 0) {\r
// We need to connect to the global table of ports\r
\r
}\r
-\r
\r
- rc = g_pSdpDriver->m_pSdpArp->SourcePortGidFromIP(m_SrcIp, &m_SrcPortGuid, &m_SrcCaGuid);\r
+ rc = g_pSdpDriver->m_pSdpArp->SourcePortGidFromIP(SrcIp, &m_SrcPortGuid, &m_SrcCaGuid);\r
if (!NT_SUCCESS(rc)) {\r
SDP_PRINT(SDP_ERR, SDP_SOCKET, ("m_pSdpArp->SourcePortGidFromIP failed rc = 0x%x\n", rc ));\r
pWspConnectOut->Errno = WSAENETUNREACH; // BUGBUG: verify this error\r
if( ib_status != IB_SUCCESS ) {\r
SDP_PRINT(SDP_ERR, SDP_SOCKET, ("ib_cm_rep failed ib_status = 0x%d\n", ib_status ));\r
rc = IB2Status(ib_status);\r
- goto Cleanup;\r
+ goto ErrorLocked;\r
}\r
\r
// Add this socket to the list of sockets ?????? should this also be done on errors ????\r