Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: net/quic/quic_connection_logger.cc

Issue 294823002: Treat IPv4-mapped IPv6 addresses as IPv4 addresses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Change histogram owners Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_address_mismatch_test.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_logger.cc
===================================================================
--- net/quic/quic_connection_logger.cc (revision 271511)
+++ net/quic/quic_connection_logger.cc (working copy)
@@ -251,7 +251,7 @@
if (sample < 0) {
return;
}
- UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.PublicResetAddressMismatch",
+ UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.PublicResetAddressMismatch2",
sample, QUIC_ADDRESS_MISMATCH_MAX);
}
@@ -300,6 +300,12 @@
return description;
}
+// If |address| is an IPv4-mapped IPv6 address, returns ADDRESS_FAMILY_IPV4
+// instead of ADDRESS_FAMILY_IPV6. Othewise, behaves like GetAddressFamily().
+AddressFamily GetRealAddressFamily(const IPAddressNumber& address) {
+ return IsIPv4Mapped(address) ? ADDRESS_FAMILY_IPV4 :
+ GetAddressFamily(address);
+}
} // namespace
@@ -431,7 +437,7 @@
if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) {
local_address_from_self_ = self_address;
UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.ConnectionTypeFromSelf",
- self_address.GetFamily(),
+ GetRealAddressFamily(self_address.address()),
ADDRESS_FAMILY_LAST);
}
@@ -594,7 +600,8 @@
decoder.Decode(address.data(), address.size())) {
local_address_from_shlo_ = IPEndPoint(decoder.ip(), decoder.port());
UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.ConnectionTypeFromPeer",
- local_address_from_shlo_.GetFamily(),
+ GetRealAddressFamily(
+ local_address_from_shlo_.address()),
ADDRESS_FAMILY_LAST);
}
}
« no previous file with comments | « net/quic/quic_address_mismatch_test.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698