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

Issue 10442098: [net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RFC3484. (Closed)

Created:
8 years, 6 months ago by szym
Modified:
8 years, 4 months ago
Reviewers:
cbentzel, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

[net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RFC3484. BUG=113993 TEST=./net_unittests --gtest_filter=AddressSorter*:HostResolverImplDnsTest.DnsTaskUnspec Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=151586

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : fixes for win #

Patch Set 4 : Working AddressSorterWin + measurements. #

Total comments: 13

Patch Set 5 : Rebased. Renamed DNS_SUCCESS. Resolve IPv4 first. #

Patch Set 6 : sync and plug AddressTrackerLinux in #

Patch Set 7 : Fix platform-dependent include #

Patch Set 8 : Build SourceAddressMap for MACOSX/BSD (and sync forced by git cl) #

Patch Set 9 : sync #

Patch Set 10 : Make the socket for WSAIoctl persistent. #

Patch Set 11 : handle ipv4-mapped addresses on win xp #

Patch Set 12 : Expanded DnsTaskUnspec to cover partial responses. #

Patch Set 13 : cosmetic #

Patch Set 14 : Minor edits. Fix one typo in variable name. #

Total comments: 63

Patch Set 15 : Make AddressSorter::Sort asynchronous #

Patch Set 16 : Added tests, fixed policy tables, addressed nits. #

Patch Set 17 : add NET_EXPORT #

Patch Set 18 : Handle ifa_netmnask == NULL and other errors after getifaddrs. #

Total comments: 19

Patch Set 19 : address comments #

Patch Set 20 : Fix FromSockAddr usage on OSX/BSD. Address nits. #

Patch Set 21 : rename addr to mask #

Patch Set 22 : add NOTREACHED #

Patch Set 23 : Replace WaitableEvent with TestCompletionCallback. #

Total comments: 42

Patch Set 24 : responded to review #

Patch Set 25 : responded to review #

Patch Set 26 : sync #

Total comments: 10

Patch Set 27 : responded to review #

Patch Set 28 : fixed needs_sort #

Total comments: 3

Patch Set 29 : updated needs_sort #

Total comments: 13

Patch Set 30 : responded to review #

Patch Set 31 : remove one more header from address_sorter_posix.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1536 lines, -111 lines) Patch
M net/base/host_resolver_impl.h View 1 2 3 4 5 1 chunk +6 lines, -3 lines 0 comments Download
M net/base/host_resolver_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 7 chunks +128 lines, -34 lines 0 comments Download
M net/base/host_resolver_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +55 lines, -3 lines 0 comments Download
M net/base/net_error_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 25 1 chunk +3 lines, -0 lines 0 comments Download
M net/base/net_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +8 lines, -0 lines 0 comments Download
M net/base/net_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +23 lines, -3 lines 0 comments Download
M net/base/net_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +23 lines, -0 lines 0 comments Download
A net/dns/address_sorter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +46 lines, -0 lines 0 comments Download
A net/dns/address_sorter_posix.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +94 lines, -0 lines 0 comments Download
A net/dns/address_sorter_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +428 lines, -0 lines 0 comments Download
A net/dns/address_sorter_posix_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +325 lines, -0 lines 0 comments Download
A net/dns/address_sorter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +49 lines, -0 lines 0 comments Download
A net/dns/address_sorter_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +197 lines, -0 lines 0 comments Download
M net/dns/dns_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -2 lines 0 comments Download
M net/dns/dns_client.cc View 3 chunks +9 lines, -1 line 0 comments Download
M net/dns/dns_response.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +2 lines, -2 lines 0 comments Download
M net/dns/dns_response.cc View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M net/dns/dns_response_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +3 lines, -2 lines 0 comments Download
M net/dns/dns_test_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +21 lines, -1 line 0 comments Download
M net/dns/dns_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +101 lines, -56 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +6 lines, -0 lines 0 comments Download
M net/tools/dns_fuzz_stub/dns_fuzz_stub.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 51 (0 generated)
cbentzel
cool
8 years, 6 months ago (2012-06-02 00:52:45 UTC) #1
szym
If you feel adventurous, this should now work on Windows (Vista+). I need to devise ...
8 years, 6 months ago (2012-06-07 01:48:04 UTC) #2
mmenke
Preliminary comments. I'm going to have to take a close look at the relevant RFCs ...
8 years, 6 months ago (2012-06-07 18:32:34 UTC) #3
mmenke
Oh...Were you not asking for comments yet? I didn't even read what you said, just ...
8 years, 6 months ago (2012-06-08 18:12:53 UTC) #4
mmenke
Are you waiting for more comments from me on this CL, or still working on ...
8 years, 6 months ago (2012-06-14 15:02:35 UTC) #5
szym
Still working on AddressTracker which will be used by Linux. Alternatively, to keep this CL ...
8 years, 6 months ago (2012-06-14 15:24:19 UTC) #6
mmenke
I'm fine with this as a single CL. All the new complexity is in the ...
8 years, 6 months ago (2012-06-14 15:32:16 UTC) #7
szym
It took a while, but this is now ready for review. Some things have been ...
8 years, 5 months ago (2012-07-25 21:58:33 UTC) #8
cbentzel
Likely won't get to it until tomorrow. On Wed, Jul 25, 2012 at 5:58 PM, ...
8 years, 5 months ago (2012-07-26 20:33:37 UTC) #9
mmenke
On 2012/07/26 20:33:37, cbentzel wrote: > Likely won't get to it until tomorrow. > > ...
8 years, 5 months ago (2012-07-26 20:34:47 UTC) #10
cbentzel
On 2012/07/26 20:33:37, cbentzel wrote: > Likely won't get to it until tomorrow. Yeah - ...
8 years, 5 months ago (2012-07-26 20:35:00 UTC) #11
mmenke
Still working my way through the ietf draft for the second time, but thought I'd ...
8 years, 4 months ago (2012-07-27 20:51:47 UTC) #12
cbentzel
I haven't even gone through the details, just trying to understand the interface. http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h File ...
8 years, 4 months ago (2012-07-30 15:30:14 UTC) #13
mmenke
Some comments I put together last week. Didn't have time to work my way through ...
8 years, 4 months ago (2012-07-30 15:37:00 UTC) #14
cbentzel
I definitely need to go back over the AddressSorter implementations. Mainly happy with interface and ...
8 years, 4 months ago (2012-07-30 15:53:43 UTC) #15
szym
http://codereview.chromium.org/10442098/diff/77004/net/base/host_resolver_impl_unittest.cc File net/base/host_resolver_impl_unittest.cc (right): http://codereview.chromium.org/10442098/diff/77004/net/base/host_resolver_impl_unittest.cc#newcode1323 net/base/host_resolver_impl_unittest.cc:1323: TEST_F(HostResolverImplDnsTest, DnsTaskUnspec) { On 2012/07/30 15:37:00, Matt Menke wrote: ...
8 years, 4 months ago (2012-07-30 16:28:45 UTC) #16
mmenke1
http://codereview.chromium.org/10442098/diff/77004/net/base/host_resolver_impl_unittest.cc File net/base/host_resolver_impl_unittest.cc (right): http://codereview.chromium.org/10442098/diff/77004/net/base/host_resolver_impl_unittest.cc#newcode1323 net/base/host_resolver_impl_unittest.cc:1323: TEST_F(HostResolverImplDnsTest, DnsTaskUnspec) { On 2012/07/30 16:28:45, szym wrote: > ...
8 years, 4 months ago (2012-07-30 17:19:06 UTC) #17
szym
Given the feedback so far, I'll be adding unittests to exercise AddressSorterPosix and I'll move ...
8 years, 4 months ago (2012-07-30 17:34:49 UTC) #18
cbentzel
http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h File net/dns/address_sorter.h (right): http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h#newcode15 net/dns/address_sorter.h:15: class AddressSorter { On 2012/07/30 16:28:45, szym wrote: > ...
8 years, 4 months ago (2012-07-30 18:18:46 UTC) #19
szym
http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h File net/dns/address_sorter.h (right): http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h#newcode15 net/dns/address_sorter.h:15: class AddressSorter { On 2012/07/30 18:18:47, cbentzel wrote: > ...
8 years, 4 months ago (2012-07-30 18:24:16 UTC) #20
mmenke1
On 2012/07/30 18:24:16, szym wrote: > http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h > File net/dns/address_sorter.h (right): > > http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter.h#newcode15 > ...
8 years, 4 months ago (2012-07-30 18:27:00 UTC) #21
szym
On 2012/07/30 18:27:00, mmenke (incorrect) wrote: > Have you verified that AddressSorterWin really requires a ...
8 years, 4 months ago (2012-07-30 18:33:55 UTC) #22
mmenke
On 2012/07/30 18:33:55, szym wrote: > On 2012/07/30 18:27:00, mmenke (incorrect) wrote: > > Have ...
8 years, 4 months ago (2012-07-30 18:35:52 UTC) #23
mmenke
http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter_posix.cc File net/dns/address_sorter_posix.cc (right): http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter_posix.cc#newcode44 net/dns/address_sorter_posix.cc:44: // http://www.akkadia.org/drepper/linux-rfc3484.html Is this still needed? Looks like the ...
8 years, 4 months ago (2012-07-30 19:40:34 UTC) #24
szym
http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter_posix.cc File net/dns/address_sorter_posix.cc (right): http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter_posix.cc#newcode44 net/dns/address_sorter_posix.cc:44: // http://www.akkadia.org/drepper/linux-rfc3484.html On 2012/07/30 19:40:34, Matt Menke wrote: > ...
8 years, 4 months ago (2012-07-30 20:55:52 UTC) #25
mmenke
http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter_posix.cc File net/dns/address_sorter_posix.cc (right): http://codereview.chromium.org/10442098/diff/77004/net/dns/address_sorter_posix.cc#newcode376 net/dns/address_sorter_posix.cc:376: el->src = &mock_source_info_; On 2012/07/30 20:55:52, szym wrote: > ...
8 years, 4 months ago (2012-07-30 21:07:16 UTC) #26
szym
Summary of changes since last review: - Made AddressSorter::Sort asynchronous to facilitate WSAIoctl on WorkerPool. ...
8 years, 4 months ago (2012-08-06 23:22:20 UTC) #27
mmenke
A couple minor comments. I still want to do a really careful pass or two ...
8 years, 4 months ago (2012-08-07 18:30:27 UTC) #28
szym
I addressed Matt's comments. http://codereview.chromium.org/10442098/diff/71025/net/dns/address_sorter_posix.cc File net/dns/address_sorter_posix.cc (right): http://codereview.chromium.org/10442098/diff/71025/net/dns/address_sorter_posix.cc#newcode185 net/dns/address_sorter_posix.cc:185: } On 2012/08/07 18:30:27, Matt ...
8 years, 4 months ago (2012-08-07 20:02:48 UTC) #29
mmenke1
http://codereview.chromium.org/10442098/diff/71025/net/dns/address_sorter_posix.cc File net/dns/address_sorter_posix.cc (right): http://codereview.chromium.org/10442098/diff/71025/net/dns/address_sorter_posix.cc#newcode185 net/dns/address_sorter_posix.cc:185: } On 2012/08/07 20:02:48, szym wrote: > On 2012/08/07 ...
8 years, 4 months ago (2012-08-07 20:08:50 UTC) #30
szym
http://codereview.chromium.org/10442098/diff/71025/net/dns/address_sorter_posix.cc File net/dns/address_sorter_posix.cc (right): http://codereview.chromium.org/10442098/diff/71025/net/dns/address_sorter_posix.cc#newcode185 net/dns/address_sorter_posix.cc:185: } On 2012/08/07 20:08:50, mmenke (incorrect) wrote: > On ...
8 years, 4 months ago (2012-08-07 20:13:33 UTC) #31
mmenke
I'm pretty happy with this. Is there a single RFC that talks about scopes? I ...
8 years, 4 months ago (2012-08-09 19:51:11 UTC) #32
szym
Thanks for the review. Some comments up-front before I upload the next patch. http://codereview.chromium.org/10442098/diff/80068/net/base/host_resolver_impl.cc File ...
8 years, 4 months ago (2012-08-10 05:56:01 UTC) #33
mmenke
http://codereview.chromium.org/10442098/diff/80068/net/dns/address_sorter_posix_unittest.cc File net/dns/address_sorter_posix_unittest.cc (right): http://codereview.chromium.org/10442098/diff/80068/net/dns/address_sorter_posix_unittest.cc#newcode285 net/dns/address_sorter_posix_unittest.cc:285: AddMapping("fe81::1", "fe81::10"); // matching link-local On 2012/08/10 05:56:01, szym ...
8 years, 4 months ago (2012-08-10 14:20:11 UTC) #34
mmenke1
http://codereview.chromium.org/10442098/diff/80068/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/80068/net/base/host_resolver_impl.cc#newcode1144 net/base/host_resolver_impl.cc:1144: OnFailure(ERR_NAME_NOT_RESOLVED, DnsResponse::DNS_NO_ADDRESSES); On 2012/08/10 05:56:01, szym wrote: > On ...
8 years, 4 months ago (2012-08-10 14:47:10 UTC) #35
szym
http://codereview.chromium.org/10442098/diff/80068/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/80068/net/base/host_resolver_impl.cc#newcode1144 net/base/host_resolver_impl.cc:1144: OnFailure(ERR_NAME_NOT_RESOLVED, DnsResponse::DNS_NO_ADDRESSES); On 2012/08/10 14:47:10, mmenke (incorrect) wrote: > ...
8 years, 4 months ago (2012-08-10 15:04:39 UTC) #36
mmenke
http://codereview.chromium.org/10442098/diff/80068/net/dns/address_sorter_win.cc File net/dns/address_sorter_win.cc (right): http://codereview.chromium.org/10442098/diff/80068/net/dns/address_sorter_win.cc#newcode91 net/dns/address_sorter_win.cc:91: buffer_size_, buffer_.get(), buffer_size_, On 2012/08/10 15:04:39, szym wrote: > ...
8 years, 4 months ago (2012-08-10 15:12:44 UTC) #37
szym
I addressed all the nits. One significant change is that in DnsTask, AddressSorter::Sort is no ...
8 years, 4 months ago (2012-08-11 22:04:20 UTC) #38
mmenke
Only found one significant issue. I'm about ready to sign off on this. http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc File ...
8 years, 4 months ago (2012-08-13 20:11:50 UTC) #39
szym
All done, except for the IMPORTANT issue, which I clarified. http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc#newcode1138 ...
8 years, 4 months ago (2012-08-13 20:28:26 UTC) #40
mmenke1
http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc#newcode1138 net/base/host_resolver_impl.cc:1138: needs_sort = (addr_list.size() > 1); On 2012/08/13 20:28:26, szym ...
8 years, 4 months ago (2012-08-13 20:34:32 UTC) #41
szym
Fixed. http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/85053/net/base/host_resolver_impl.cc#newcode1138 net/base/host_resolver_impl.cc:1138: needs_sort = (addr_list.size() > 1); On 2012/08/13 20:34:33, ...
8 years, 4 months ago (2012-08-13 20:39:35 UTC) #42
mmenke1
http://codereview.chromium.org/10442098/diff/80075/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/80075/net/base/host_resolver_impl.cc#newcode1139 net/base/host_resolver_impl.cc:1139: needs_sort = (addr_list.size() > 1); So what do you ...
8 years, 4 months ago (2012-08-13 20:45:10 UTC) #43
szym
http://codereview.chromium.org/10442098/diff/80075/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/80075/net/base/host_resolver_impl.cc#newcode1139 net/base/host_resolver_impl.cc:1139: needs_sort = (addr_list.size() > 1); On 2012/08/13 20:45:10, mmenke ...
8 years, 4 months ago (2012-08-13 20:56:23 UTC) #44
mmenke1
http://codereview.chromium.org/10442098/diff/80075/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/80075/net/base/host_resolver_impl.cc#newcode1139 net/base/host_resolver_impl.cc:1139: needs_sort = (addr_list.size() > 1); On 2012/08/13 20:56:23, szym ...
8 years, 4 months ago (2012-08-13 21:16:51 UTC) #45
mmenke
A couple final nits, and I'm ready to sign off on this. http://codereview.chromium.org/10442098/diff/94032/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc ...
8 years, 4 months ago (2012-08-14 15:56:12 UTC) #46
szym
All done. http://codereview.chromium.org/10442098/diff/94032/net/base/host_resolver_impl.cc File net/base/host_resolver_impl.cc (right): http://codereview.chromium.org/10442098/diff/94032/net/base/host_resolver_impl.cc#newcode1135 net/base/host_resolver_impl.cc:1135: ttl = std::min(ttl, first_ttl_); On 2012/08/14 15:56:12, ...
8 years, 4 months ago (2012-08-14 20:02:26 UTC) #47
mmenke1
LGTM!
8 years, 4 months ago (2012-08-14 20:07:11 UTC) #48
szym
On 2012/08/14 20:07:11, mmenke (incorrect) wrote: > LGTM! Many thanks for the meticulous review!
8 years, 4 months ago (2012-08-14 20:08:22 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/szym@chromium.org/10442098/75111
8 years, 4 months ago (2012-08-14 20:16:00 UTC) #50
commit-bot: I haz the power
8 years, 4 months ago (2012-08-14 22:36:37 UTC) #51
Change committed as 151586

Powered by Google App Engine
This is Rietveld 408576698