summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authoragayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-29 03:47:04 +0000
committeragayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-29 03:47:04 +0000
commit5370c013eb6372dbffe91de3fde793da6b74e4e1 (patch)
treef4a14d0380e1c673c1e0d54f75a192fc1b504b9e /net/base
parent034bda715a6756a9b07de1fe9db9ceb6caf73123 (diff)
downloadchromium_src-5370c013eb6372dbffe91de3fde793da6b74e4e1.zip
chromium_src-5370c013eb6372dbffe91de3fde793da6b74e4e1.tar.gz
chromium_src-5370c013eb6372dbffe91de3fde793da6b74e4e1.tar.bz2
Add support for random UDP source port selection to avoid birthday attacks in DNS implementation.
BUG=60149 TEST=net_unittests Review URL: http://codereview.chromium.org/7202011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/net_error_list.h3
-rw-r--r--net/base/net_errors_posix.cc2
-rw-r--r--net/base/net_errors_win.cc2
3 files changed, 7 insertions, 0 deletions
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index 6cf561b..b6aaa5b 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -252,6 +252,9 @@ NET_ERROR(DNS_SERVER_FAILED, -145)
// WebSocket abort SocketStream connection when alternate protocol is found.
NET_ERROR(PROTOCOL_SWITCHED, -146)
+// Returned when attempting to bind an address that is already in use.
+NET_ERROR(ADDRESS_IN_USE, -147)
+
// Certificate error codes
//
// The values of certificate error codes must be consecutive.
diff --git a/net/base/net_errors_posix.cc b/net/base/net_errors_posix.cc
index 6958801..31450f9 100644
--- a/net/base/net_errors_posix.cc
+++ b/net/base/net_errors_posix.cc
@@ -46,6 +46,8 @@ Error MapSystemError(int os_error) {
return ERR_SOCKET_NOT_CONNECTED;
case EINVAL:
return ERR_INVALID_ARGUMENT;
+ case EADDRINUSE:
+ return ERR_ADDRESS_IN_USE;
case 0:
return OK;
default:
diff --git a/net/base/net_errors_win.cc b/net/base/net_errors_win.cc
index 0fff5d6..c290020 100644
--- a/net/base/net_errors_win.cc
+++ b/net/base/net_errors_win.cc
@@ -46,6 +46,8 @@ Error MapSystemError(int os_error) {
return ERR_ADDRESS_UNREACHABLE;
case WSAEINVAL:
return ERR_INVALID_ARGUMENT;
+ case WSAEADDRINUSE:
+ return ERR_ADDRESS_IN_USE;
case ERROR_SUCCESS:
return OK;
default: