From 9cb4e3d1cafc5271978715e0ccacdc0829f5ddd8 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 6 Sep 2015 20:53:06 -0400 Subject: [PATCH] forward-port supports_ipv6() fix for linux from RC_1_0 (and fix bug in it) --- src/broadcast_socket.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/broadcast_socket.cpp b/src/broadcast_socket.cpp index ccb90a57e..3fd611b01 100644 --- a/src/broadcast_socket.cpp +++ b/src/broadcast_socket.cpp @@ -148,11 +148,19 @@ namespace libtorrent bool supports_ipv6() { #if TORRENT_USE_IPV6 +#ifdef TORRENT_WINDOWS TORRENT_TRY { error_code ec; address::from_string("::1", ec); return !ec; } TORRENT_CATCH(std::exception&) { return false; } +#else + io_service ios; + tcp::socket test(ios); + error_code ec; + test.open(tcp::v6(), ec); + return !bool(ec); +#endif // WINDOWS #else return false; #endif