Opened 8 years ago
Last modified 8 years ago
#10508 new Bugs
Hang occurs if tcp::socket.connect(endpt, errorcode) is called with reserved IP address
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | asio tcp socket connect | Cc: |
Description
boost::asio::ip::tcp::socket.connect( EndPt, ec) hangs in detail/impl/socket_opps.ipp:472 on the call
template <typename SockLenType> inline int call_connect(SockLenType msghdr::*,
socket_type s, const socket_addr_type* addr, std::size_t addrlen)
{
return ::connect(s, addr, (SockLenType)addrlen); <== HANGS
}
if the IP address is Valid but reserved. 127.0.0.1 & any established private network subnet address work fine with either a connection or an errorcode return specifying the connection was refused.
Change History (2)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
iMac OSX 10.9.4
Xcode 5.1.1
Above comment better formatted, I hope:
addr const socket_addr_type * 0x7fff5fbfe620 0x00007fff5fbfe620
sa_len uint8_t '\0' '\0'
sa_family sa_family_t '\x02' '\x02'
sa_data char [14] "\x15|\xc0"
[0] char '\x15' '\x15'
[1] char '|' '|'
[2] char '\xc0' '\xc0'
[3] char '\0' '\0'
[4] char '\x02' '\x02'
[5] char 'z' 'z'
[6] char '\0' '\0'
[7] char '\0' '\0'
[8] char '\0' '\0'
[9] char '\0' '\0'
[10] char '\0' '\0'
[11] char '\0' '\0'
[12] char '\0' '\0'
[13] char '\0' '\0'
s = boost::asio::detail::socket_type 22 22
addrlen = size_t 16 16
The debug info at the call to connect(s, addr, (SockLenType)addrlen) is:
addr const socket_addr_type * 0x7fff5fbfe620 0x00007fff5fbfe620 sa_len uint8_t '\0' '\0' sa_family sa_family_t '\x02' '\x02' sa_data char [14] "\x15|\xc0" [0] char '\x15' '\x15' [1] char '|' '|' [2] char '\xc0' '\xc0' [3] char '\0' '\0' [4] char '\x02' '\x02' [5] char 'z' 'z' [6] char '\0' '\0' [7] char '\0' '\0' [8] char '\0' '\0' [9] char '\0' '\0' [10] char '\0' '\0' [11] char '\0' '\0' [12] char '\0' '\0' [13] char '\0' '\0' s boost::asio::detail::socket_type 22 22 addrlen size_t 16 16