Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1775)

Unified Diff: runtime/bin/socket_macos.cc

Issue 14766003: Add v6Only named argument to ServerSocket and etc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/socket_macos.cc
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index bf170567a34f29f45f69525db1996d966810527f..94363fb74f45bb0b38c8134018b3776b387d895f 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -207,7 +207,8 @@ SocketAddresses* Socket::LookupAddress(const char* host,
intptr_t ServerSocket::CreateBindListen(RawAddr addr,
intptr_t port,
- intptr_t backlog) {
+ intptr_t backlog,
+ bool v6_only) {
intptr_t fd;
fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
@@ -220,7 +221,7 @@ intptr_t ServerSocket::CreateBindListen(RawAddr addr,
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
if (addr.ss.ss_family == AF_INET6) {
- optval = 0;
+ optval = v6_only ? 1 : 0;
VOID_TEMP_FAILURE_RETRY(
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
}

Powered by Google App Engine
This is Rietveld 408576698