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

Unified Diff: runtime/bin/socket_android.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_android.cc
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index e4b99bd717230b5151c0916321fa408374181379..8bb8f076e2485de602500a5822bbb8ac4d0f884e 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -195,7 +195,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));
@@ -208,7 +209,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;
TEMP_FAILURE_RETRY(
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
}
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/socket_linux.cc » ('j') | runtime/bin/socket_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698