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

Unified Diff: net/dns/dns_config_service.cc

Issue 10833017: Fix gcc 4.7 building problems - cont 2. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
Index: net/dns/dns_config_service.cc
diff --git a/net/dns/dns_config_service.cc b/net/dns/dns_config_service.cc
index a520d261b9dbe6ac2f53a5e786ff766eeb55634f..dd6bac3a5c92ccae47d79b58f409a0f3ba58b73b 100644
--- a/net/dns/dns_config_service.cc
+++ b/net/dns/dns_config_service.cc
@@ -16,21 +16,23 @@ namespace {
// Check if particular nameserver address is rogue. See:
// http://www.fbi.gov/news/stories/2011/november/malware_110911/DNS-changer-malware.pdf
bool CheckRogueDnsAddress(const IPAddressNumber& address) {
+#define _C_(x) static_cast<unsigned char>(x)
agl 2012/07/25 20:32:34 _C_ is an odd name for a macro. How about U8?
Han 2012/07/25 22:28:44 Done.
const struct Bounds {
const unsigned char lower[4]; // inclusive
const unsigned char upper[4]; // exclusive
} cases[] = {
- { { '\x55', '\xFF', '\x70', '\x00' }, // 85.255.112.0
- { '\x55', '\xFF', '\x80', '\x00' } }, // 85.255.128.0
- { { '\x43', '\xD2', '\x00', '\x00' }, // 67.210.0.0
- { '\x43', '\xD2', '\x10', '\x00' } }, // 67.210.16.0
- { { '\x5D', '\xBC', '\xA0', '\x00' }, // 93.188.160.0
- { '\x5D', '\xBC', '\xA8', '\x00' } }, // 93.188.168.0
- { { '\x4D', '\x43', '\x53', '\x00' }, // 77.67.83.0
- { '\x4D', '\x43', '\x54', '\x00' } }, // 77.67.84.0
- { { '\x40', '\x1C', '\xB2', '\x00' }, // 64.28.178.0
- { '\x40', '\x1C', '\xC0', '\x00' } }, // 64.28.192.0
+ { { _C_('\x55'), _C_('\xFF'), _C_('\x70'), _C_('\x00') }, // 85.255.112.0
+ { _C_('\x55'), _C_('\xFF'), _C_('\x80'), _C_('\x00') } }, // 85.255.128.0
+ { { _C_('\x43'), _C_('\xD2'), _C_('\x00'), _C_('\x00') }, // 67.210.0.0
+ { _C_('\x43'), _C_('\xD2'), _C_('\x10'), _C_('\x00') } }, // 67.210.16.0
+ { { _C_('\x5D'), _C_('\xBC'), _C_('\xA0'), _C_('\x00') }, // 93.188.160.0
+ { _C_('\x5D'), _C_('\xBC'), _C_('\xA8'), _C_('\x00') } }, // 93.188.168.0
+ { { _C_('\x4D'), _C_('\x43'), _C_('\x53'), _C_('\x00') }, // 77.67.83.0
+ { _C_('\x4D'), _C_('\x43'), _C_('\x54'), _C_('\x00') } }, // 77.67.84.0
+ { { _C_('\x40'), _C_('\x1C'), _C_('\xB2'), _C_('\x00') }, // 64.28.178.0
+ { _C_('\x40'), _C_('\x1C'), _C_('\xC0'), _C_('\x00') } }, // 64.28.192.0
};
+#undef _C_
for (unsigned i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
const Bounds& bounds = cases[i];
IPAddressNumber lower(bounds.lower, bounds.lower + 4);

Powered by Google App Engine
This is Rietveld 408576698