Index: net/base/ip_endpoint.cc |
diff --git a/net/base/ip_endpoint.cc b/net/base/ip_endpoint.cc |
index 8dc8e9ace3571161b35cbda39403e2fdf1103793..923596e810cb352923d49f2d64cb22cefaef0416 100644 |
--- a/net/base/ip_endpoint.cc |
+++ b/net/base/ip_endpoint.cc |
@@ -34,7 +34,19 @@ IPEndPoint::IPEndPoint(const IPEndPoint& endpoint) { |
port_ = endpoint.port_; |
} |
-int IPEndPoint::GetFamily() const { |
+AddressFamily IPEndPoint::GetFamily() const { |
+ switch (address_.size()) { |
+ case kIPv4AddressSize: |
+ return ADDRESS_FAMILY_IPV4; |
+ case kIPv6AddressSize: |
+ return ADDRESS_FAMILY_IPV6; |
+ default: |
+ NOTREACHED() << "Bad IP address"; |
+ return ADDRESS_FAMILY_UNSPECIFIED; |
+ } |
+} |
+ |
+int IPEndPoint::GetSockAddrFamily() const { |
switch (address_.size()) { |
case kIPv4AddressSize: |
return AF_INET; |