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

Issue 22538003: Add IP address handling to net::IsHostnameNonUnique (Closed)

Created:
7 years, 4 months ago by felt
Modified:
7 years, 4 months ago
Reviewers:
Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org
Visibility:
Public.

Description

Adds a new method, net::IsIPAddressReserved, that returns true if an IP address belongs to a reserved IANA range. This includes *all* reserved IANA ranges. Applies to both IPv4 and IPv6. I used the following IANA links to decide whether a given range is reserved: https://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xml BUG=225570, 119212, 116838 TEST=net_unittest R=rsleevi@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219193

Patch Set 1 #

Patch Set 2 : Switched from private to all reserved, separated ipv4 and ipv6 #

Patch Set 3 : Adding logging statements to debug linux asan failure #

Total comments: 12

Patch Set 4 : Rewrote IsIPAddressReserved to avoid conversions #

Patch Set 5 : Removed logging statement that was there for trybot testing #

Patch Set 6 : Made arrays const #

Total comments: 7

Patch Set 7 : Rewritten with the prefix check as its own helper method #

Total comments: 17

Patch Set 8 : Take 3 #

Total comments: 15

Patch Set 9 : mods #

Patch Set 10 : Changes to the comment #

Total comments: 6

Patch Set 11 : Added test ases #

Patch Set 12 : Rebased #

Patch Set 13 : Looking for broken android tests #

Patch Set 14 : Disabled internal network check on Android #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -40 lines) Patch
M net/base/net_util.h View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -4 lines 0 comments Download
M net/base/net_util.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +92 lines, -25 lines 0 comments Download
M net/base/net_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -8 lines 0 comments Download
M net/cert/cert_verify_proc.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -2 lines 0 comments Download
M net/cert/cert_verify_proc_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +9 lines, -1 line 0 comments Download

Messages

Total messages: 33 (0 generated)
felt
Hi Ryan, can you please review this? Note: 676768 (which you included in your test ...
7 years, 4 months ago (2013-08-07 09:30:57 UTC) #1
Ryan Sleevi
https://codereview.chromium.org/22538003/diff/14001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/14001/net/base/net_util.cc#newcode1438 net/base/net_util.cc:1438: if (!ParseIPLiteralToNumber(hostname, &host_addr)) return false; nit: linebreak for the ...
7 years, 4 months ago (2013-08-07 19:04:44 UTC) #2
felt
Hi Ryan, I rewrote this to use char arrays with no conversions. It should be ...
7 years, 4 months ago (2013-08-08 19:35:33 UTC) #3
Ryan Sleevi
https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc#newcode1410 net/base/net_util.cc:1410: if (!ParseIPLiteralToNumber(hostname, &host_addr)) CanonicalizeHost is going to put the ...
7 years, 4 months ago (2013-08-08 19:49:31 UTC) #4
felt
https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc#newcode1469 net/base/net_util.cc:1469: size_t arr_size = (ipv4) ? On 2013/08/08 19:49:31, Ryan ...
7 years, 4 months ago (2013-08-08 19:52:47 UTC) #5
Ryan Sleevi
On 2013/08/08 19:52:47, felt wrote: > https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc > File net/base/net_util.cc (right): > > https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc#newcode1469 > ...
7 years, 4 months ago (2013-08-08 19:57:20 UTC) #6
felt
https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc#newcode1410 net/base/net_util.cc:1410: if (!ParseIPLiteralToNumber(hostname, &host_addr)) On 2013/08/08 19:49:31, Ryan Sleevi wrote: ...
7 years, 4 months ago (2013-08-09 04:53:20 UTC) #7
felt
On 2013/08/08 19:57:20, Ryan Sleevi wrote: > On 2013/08/08 19:52:47, felt wrote: > > https://codereview.chromium.org/22538003/diff/26001/net/base/net_util.cc ...
7 years, 4 months ago (2013-08-09 04:54:02 UTC) #8
felt
Hi Ryan, do you think you could take a quick peek this afternoon and indicate ...
7 years, 4 months ago (2013-08-09 22:41:49 UTC) #9
Ryan Sleevi
Looking much better - but there's an opportunity for even more reduction (and eliminating the ...
7 years, 4 months ago (2013-08-09 22:50:12 UTC) #10
Ryan Sleevi
https://codereview.chromium.org/22538003/diff/39001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/39001/net/base/net_util.cc#newcode1505 net/base/net_util.cc:1505: } On 2013/08/09 22:50:12, Ryan Sleevi wrote: > FWIW, ...
7 years, 4 months ago (2013-08-09 22:51:31 UTC) #11
felt
Alas. However, I've had another go. https://codereview.chromium.org/22538003/diff/39001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/39001/net/base/net_util.cc#newcode1440 net/base/net_util.cc:1440: template<typename Arr, typename ...
7 years, 4 months ago (2013-08-10 03:04:32 UTC) #12
Ryan Sleevi
A few last nits, but I think we're in the home stretch. https://codereview.chromium.org/22538003/diff/50001/net/base/net_util.cc File net/base/net_util.cc ...
7 years, 4 months ago (2013-08-12 21:11:51 UTC) #13
felt
Thanks, updated https://codereview.chromium.org/22538003/diff/50001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/50001/net/base/net_util.cc#newcode1456 net/base/net_util.cc:1456: if ((ip_number[i] & mask) != (ip_prefix[i] & ...
7 years, 4 months ago (2013-08-13 04:17:06 UTC) #14
Ryan Sleevi
LGTM with nits. https://codereview.chromium.org/22538003/diff/50001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/50001/net/base/net_util.cc#newcode1505 net/base/net_util.cc:1505: for (size_t i = 0; i ...
7 years, 4 months ago (2013-08-13 20:45:39 UTC) #15
felt
https://codereview.chromium.org/22538003/diff/63001/net/base/net_util.cc File net/base/net_util.cc (right): https://codereview.chromium.org/22538003/diff/63001/net/base/net_util.cc#newcode1440 net/base/net_util.cc:1440: bool IPNumberPrefixCheck(const IPAddressNumber& ip_number, On 2013/08/13 20:45:39, Ryan Sleevi ...
7 years, 4 months ago (2013-08-14 14:18:14 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/22538003/69001
7 years, 4 months ago (2013-08-14 20:54:57 UTC) #17
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
7 years, 4 months ago (2013-08-15 12:41:18 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/22538003/69001
7 years, 4 months ago (2013-08-15 13:14:49 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/22538003/134001
7 years, 4 months ago (2013-08-16 20:47:52 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/22538003/134001
7 years, 4 months ago (2013-08-21 21:10:33 UTC) #23
felt
On 2013/08/21 21:10:33, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
7 years, 4 months ago (2013-08-21 21:12:50 UTC) #24
Ryan Sleevi
On 2013/08/21 21:12:50, felt wrote: > On 2013/08/21 21:10:33, I haz the power (commit-bot) wrote: ...
7 years, 4 months ago (2013-08-21 21:18:35 UTC) #25
felt
On 2013/08/21 21:18:35, Ryan Sleevi wrote: > On 2013/08/21 21:12:50, felt wrote: > > On ...
7 years, 4 months ago (2013-08-21 21:29:04 UTC) #26
Ryan Sleevi
Doh, I'm a fool. You're running into an issue because the cert is issued to ...
7 years, 4 months ago (2013-08-22 02:19:52 UTC) #27
felt
On 2013/08/22 02:19:52, Ryan Sleevi wrote: > Doh, I'm a fool. > > You're running ...
7 years, 4 months ago (2013-08-22 04:00:32 UTC) #28
Ryan Sleevi
On 2013/08/22 04:00:32, felt wrote: > On 2013/08/22 02:19:52, Ryan Sleevi wrote: > > Doh, ...
7 years, 4 months ago (2013-08-22 21:54:03 UTC) #29
felt
Disabled intranet check + test for Android. Running tests now to double check that everything ...
7 years, 4 months ago (2013-08-22 22:34:12 UTC) #30
Ryan Sleevi
lgtm
7 years, 4 months ago (2013-08-22 22:36:19 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/22538003/61003
7 years, 4 months ago (2013-08-23 01:08:16 UTC) #32
commit-bot: I haz the power
7 years, 4 months ago (2013-08-23 02:48:06 UTC) #33
Message was sent while issue was closed.
Change committed as 219193

Powered by Google App Engine
This is Rietveld 408576698