From fa9197ebb6d4dfc7292fa9289e008f1e6be696b4 Mon Sep 17 00:00:00 2001 From: Miralem Mehic Date: Fri, 2 Dec 2016 19:49:20 +0100 Subject: [PATCH] tcp: (fixes #2561) TCP can not use Connect after a BindToNetDevice --- RELEASE_NOTES | 1 + src/internet/model/tcp-socket-base.cc | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 9cd32ab8d..3294ec877 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -47,6 +47,7 @@ Bugs fixed - Bug 2547 - dead assignments on various tcp congestion controls - Bug 2551 - wifi preamble should be part of TXVECTOR - Bug 2552 - Remove code duplication between Yans and Spectrum +- Bug 2561 - TCP can not use Connect after a BindToNetDevice - Bug 2563 - Modify pybindgen version check to >= minimum version required - Bug 2564 - Simulation crashes when CtsTimeout is triggered for A-MPDU transmissions diff --git a/src/internet/model/tcp-socket-base.cc b/src/internet/model/tcp-socket-base.cc index 95a4a0d1a..8fcf3a85d 100644 --- a/src/internet/model/tcp-socket-base.cc +++ b/src/internet/model/tcp-socket-base.cc @@ -658,7 +658,7 @@ TcpSocketBase::Connect (const Address & address) NS_LOG_FUNCTION (this << address); // If haven't do so, Bind() this socket first - if (InetSocketAddress::IsMatchingType (address) && m_endPoint6 == 0) + if (InetSocketAddress::IsMatchingType (address)) { if (m_endPoint == 0) { @@ -681,7 +681,7 @@ TcpSocketBase::Connect (const Address & address) return -1; } } - else if (Inet6SocketAddress::IsMatchingType (address) && m_endPoint == 0) + else if (Inet6SocketAddress::IsMatchingType (address)) { // If we are operating on a v4-mapped address, translate the address to // a v4 address and re-call this function @@ -707,7 +707,8 @@ TcpSocketBase::Connect (const Address & address) // Get the appropriate local address and port number from the routing protocol and set up endpoint if (SetupEndpoint6 () != 0) - { // Route to destination does not exist + { + NS_LOG_ERROR ("Route to destination does not exist ?!"); return -1; } }