summaryrefslogtreecommitdiff
path: root/src/SocketCore.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-10-04 14:33:49 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-10-04 14:33:49 +0000
commit5db7b123b5233d26617c20d6de40921366733040 (patch)
treee47f4ee88ee995082f4366f10e9e7e5ef50d2195 /src/SocketCore.cc
parent329de2a9b56ec1e4d533759b9da4725b1b1ffb76 (diff)
2010-10-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use inet_ntoa if inet_ntop is not available. Since inet_ntoa does not handle IPv6 address, IPv6 support is limited in this case. Fixed unit test error under mingw32. * configure.ac * src/AsyncNameResolver.cc * src/SocketCore.cc * src/bittorrent_helper.cc * test/BittorrentHelperTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTRoutingTableDeserializerTest.cc * test/DHTRoutingTableSerializerTest.cc * test/DefaultBtAnnounceTest.cc * test/Metalink2RequestGroupTest.cc * test/UTPexExtensionMessageTest.cc
Diffstat (limited to 'src/SocketCore.cc')
-rw-r--r--src/SocketCore.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index e46f57d4..03eb4c5b 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -200,6 +200,7 @@ static sock_t bindInternal(int family, int socktype, int protocol,
CLOSE(fd);
return -1;
}
+#ifdef IPV6_V6ONLY
if(family == AF_INET6) {
int sockopt = 1;
if(setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (a2_sockopt_t) &sockopt,
@@ -208,6 +209,7 @@ static sock_t bindInternal(int family, int socktype, int protocol,
return -1;
}
}
+#endif // IPV6_V6ONLY
if(::bind(fd, addr, addrlen) == -1) {
error = errorMsg();
CLOSE(fd);