Chromium Code Reviews| Index: net/base/net_util.cc |
| diff --git a/net/base/net_util.cc b/net/base/net_util.cc |
| index 5b3d65e515b2a060c9eabc31458b3dde0b156e32..2142e2a838d7ec86716143aef8f39e144af6ae17 100644 |
| --- a/net/base/net_util.cc |
| +++ b/net/base/net_util.cc |
| @@ -5,6 +5,7 @@ |
| #include "net/base/net_util.h" |
| #include <errno.h> |
| +#include <string.h> |
| #include <algorithm> |
| #include <iterator> |
| @@ -501,6 +502,17 @@ bool IsIPAddressReserved(const IPAddressNumber& host_addr) { |
| return false; |
| } |
| +SockaddrStorage::SockaddrStorage(const SockaddrStorage& other) |
| + : addr_len(other.addr_len), |
| + addr(reinterpret_cast<struct sockaddr*>(&addr_storage)) { |
| + memcpy(addr, other.addr, addr_len); |
| +} |
| + |
| +void SockaddrStorage::operator=(const SockaddrStorage& other) { |
|
mmenke
2014/06/30 18:26:51
Ahh...right. Mind adding a comment along those li
byungchul
2014/06/30 19:38:34
Done.
|
| + addr_len = other.addr_len; |
| + memcpy(addr, other.addr, addr_len); |
| +} |
| + |
| // Extracts the address and port portions of a sockaddr. |
| bool GetIPAddressFromSockAddr(const struct sockaddr* sock_addr, |
| socklen_t sock_addr_len, |