This commit is contained in:
Arvid Norberg 2009-04-04 10:08:07 +00:00
parent aba5b2e9d0
commit e6f2073cd3
1 changed files with 10 additions and 0 deletions

View File

@ -4039,6 +4039,16 @@ namespace libtorrent
bind_interface.port(m_ses.next_port());
}
// if we're not binding to a specific interface, bind
// to the same protocol family as the target endpoint
if (is_any(bind_interface.address()))
{
if (m_remote.address().is_v4())
bind_interface.address(address_v4::any());
else
bind_interface.address(address_v6::any());
}
m_socket->bind(bind_interface, ec);
if (ec)
{