diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2019-12-18 22:26:41 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-13 17:32:37 +0000 |
commit | 88053febad75e48bb5ec7120f96edc0c17fb1402 (patch) | |
tree | fe25bb083f571a6723ac36a825507ead60330759 /src/mongo/transport | |
parent | e329dd322df4a226b143031c99b5f943d3a9be4a (diff) | |
download | mongo-88053febad75e48bb5ec7120f96edc0c17fb1402.tar.gz |
SERVER-45156 SockAddr constructor should take sockaddr, not sockaddr_storage
(cherry picked from commit e742c986376a7c06cee67d369261feab0efea1d3)
Diffstat (limited to 'src/mongo/transport')
-rw-r--r-- | src/mongo/transport/asio_utils.h | 4 | ||||
-rw-r--r-- | src/mongo/transport/transport_layer_asio.cpp | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/mongo/transport/asio_utils.h b/src/mongo/transport/asio_utils.h index f755693307e..48a12138432 100644 --- a/src/mongo/transport/asio_utils.h +++ b/src/mongo/transport/asio_utils.h @@ -48,9 +48,7 @@ namespace mongo { namespace transport { inline SockAddr endpointToSockAddr(const asio::generic::stream_protocol::endpoint& endPoint) { - struct sockaddr_storage sa = {}; - memcpy(&sa, endPoint.data(), endPoint.size()); - SockAddr wrappedAddr(sa, endPoint.size()); + SockAddr wrappedAddr(endPoint.data(), endPoint.size()); return wrappedAddr; } diff --git a/src/mongo/transport/transport_layer_asio.cpp b/src/mongo/transport/transport_layer_asio.cpp index 2af2708c46d..05527f0ab50 100644 --- a/src/mongo/transport/transport_layer_asio.cpp +++ b/src/mongo/transport/transport_layer_asio.cpp @@ -731,9 +731,7 @@ Status TransportLayerASIO::setup() { _listenerPort = endpointToHostAndPort(endpoint).port(); } - sockaddr_storage sa; - memcpy(&sa, addr->data(), addr->size()); - _acceptors.emplace_back(SockAddr(sa, addr->size()), std::move(acceptor)); + _acceptors.emplace_back(SockAddr(addr->data(), addr->size()), std::move(acceptor)); } if (_acceptors.empty() && _listenerOptions.isIngress()) { |