| Index: net/udp/udp_socket_win.cc
|
| diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
|
| index 1f0c337fd4a609fcb783bb0382345a88ab4ecd34..3f3e13b93a2c58186f408538927f96704456dfdf 100644
|
| --- a/net/udp/udp_socket_win.cc
|
| +++ b/net/udp/udp_socket_win.cc
|
| @@ -166,6 +166,7 @@ UDPSocketWin::UDPSocketWin(DatagramSocket::BindType bind_type,
|
| addr_family_(0),
|
| socket_options_(SOCKET_OPTION_MULTICAST_LOOP),
|
| multicast_time_to_live_(1),
|
| + dscp_(DSCP_CS0),
|
| bind_type_(bind_type),
|
| rand_int_cb_(rand_int_cb),
|
| recv_from_address_(NULL),
|
| @@ -621,6 +622,22 @@ int UDPSocketWin::SetSocketOptions() {
|
| if (rv < 0)
|
| return MapSystemError(WSAGetLastError());
|
| }
|
| + if (dscp_) {
|
| + int rw;
|
| + DWORD dscp_and_ecn = dscp_ << 2;
|
| + if (addr_family_ == AF_INET) {
|
| + rv = setsockopt(socket_, IPPROTO_IP, IP_TOS,
|
| + reinterpret_cast<const char*>(&dscp_and_ecn),
|
| + sizeof(dscp_and_ecn));
|
| + } else {
|
| + rv = setsockopt(socket_, IPPROTO_IPV6, IPV6_TCLASS,
|
| + reinterpret_cast<const char*>(&dscp_and_ecn),
|
| + sizeof(dscp_and_ecn));
|
| + }
|
| + if (rv < 0) {
|
| + LOG(INFO) << "Failed to set dscp, errno=" << errno;
|
| + }
|
| + }
|
| return OK;
|
| }
|
|
|
|
|