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

Unified Diff: runtime/bin/socket_linux.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
« no previous file with comments | « runtime/bin/socket_android.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_linux.cc
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index e881f5d7b20a57ec15058691d4d9478608ae5956..cfc9b12b1122811472857791ee6af299c7f009ef 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.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;
Søren Gjesse 2013/05/01 12:27:47 Isn't the default 1? So we only need to set it if
Anders Johnsen 2013/05/01 12:30:05 It's changeable (0 on my machine).
TEMP_FAILURE_RETRY(
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
}
« no previous file with comments | « runtime/bin/socket_android.cc ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698