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

Issue 10824238: [net/dns] Don't abandon a DnsUDPAttempt when the response does not match the query. (Closed)

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

Description

[net/dns] Don't abandon a DnsUDPAttempt when the response does not match the query. When an unexpected packet is read from the socket, the current behavior is to give up on this attempt and immediately make another one. Considerable fraction of observed failures is due to ERR_DNS_MALFORMED_RESPONSE errors which might be false positives. For example, if behind a NAT, we might be receiving packets through stale mappings (addressed to other hosts). Rather than simply ignoring malformed packets, this CL implements the behavior: "don't give up on this attempt, but immediately make another one." BUG=107413 TEST=./net_unittests --gtest_filter=DnsTransactionTest.MalformedResponse* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=154171

Patch Set 1 #

Patch Set 2 : sync #

Patch Set 3 : Handle sync and async cases. Add test. #

Total comments: 2

Patch Set 4 : implement proper behavior, refactor tests #

Patch Set 5 : delinted; comments #

Total comments: 19

Patch Set 6 : reformatted, added MismatchedResponseFail #

Patch Set 7 : rename FinishAttempt to ProcessAttemptResult #

Patch Set 8 : sync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -296 lines) Patch
M net/dns/dns_transaction.cc View 1 2 3 4 5 6 9 chunks +18 lines, -8 lines 0 comments Download
M net/dns/dns_transaction_unittest.cc View 1 2 3 4 5 22 chunks +303 lines, -286 lines 0 comments Download
M net/socket/socket_test_util.h View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
szym
8 years, 3 months ago (2012-08-28 01:10:48 UTC) #1
mmenke
http://codereview.chromium.org/10824238/diff/8002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/8002/net/dns/dns_transaction.cc#newcode154 net/dns/dns_transaction.cc:154: return received_malformed_response_ ? ERR_DNS_MALFORMED_RESPONSE : rv; Err...How does this ...
8 years, 3 months ago (2012-08-28 14:15:54 UTC) #2
szym
http://codereview.chromium.org/10824238/diff/8002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/8002/net/dns/dns_transaction.cc#newcode154 net/dns/dns_transaction.cc:154: return received_malformed_response_ ? ERR_DNS_MALFORMED_RESPONSE : rv; On 2012/08/28 14:15:54, ...
8 years, 3 months ago (2012-08-28 14:59:44 UTC) #3
szym
This is now ready for review.
8 years, 3 months ago (2012-08-28 22:12:37 UTC) #4
mmenke
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; When does this happen? Won't we just ...
8 years, 3 months ago (2012-08-29 16:23:57 UTC) #5
szym
Since making the helper method names longer required reformatting, I have reformatted all the tests. ...
8 years, 3 months ago (2012-08-29 21:37:26 UTC) #6
mmenke
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 21:37:26, szym wrote: > On ...
8 years, 3 months ago (2012-08-29 21:43:53 UTC) #7
mmenke
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 21:43:53, Matt Menke wrote: > ...
8 years, 3 months ago (2012-08-29 21:46:42 UTC) #8
szym
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 21:43:53, Matt Menke wrote: > ...
8 years, 3 months ago (2012-08-29 21:55:05 UTC) #9
mmenke
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 21:55:05, szym wrote: > On ...
8 years, 3 months ago (2012-08-29 22:01:22 UTC) #10
szym
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 22:01:22, Matt Menke wrote: > ...
8 years, 3 months ago (2012-08-29 22:19:10 UTC) #11
szym
On 2012/08/29 22:19:10, szym wrote: > > So, if I don't set received_malformed_response_ to true ...
8 years, 3 months ago (2012-08-29 22:19:42 UTC) #12
mmenke
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 22:19:11, szym wrote: > On ...
8 years, 3 months ago (2012-08-29 22:29:44 UTC) #13
mmenke
On 2012/08/29 22:29:44, Matt Menke wrote: > http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc > File net/dns/dns_transaction.cc (right): > > http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 ...
8 years, 3 months ago (2012-08-29 22:32:04 UTC) #14
szym
http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc File net/dns/dns_transaction.cc (right): http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 net/dns/dns_transaction.cc:156: return ERR_DNS_MALFORMED_RESPONSE; On 2012/08/29 22:29:44, Matt Menke wrote: > ...
8 years, 3 months ago (2012-08-29 22:33:40 UTC) #15
mmenke
On 2012/08/29 22:33:40, szym wrote: > http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc > File net/dns/dns_transaction.cc (right): > > http://codereview.chromium.org/10824238/diff/20002/net/dns/dns_transaction.cc#newcode156 > ...
8 years, 3 months ago (2012-08-29 22:39:36 UTC) #16
szym
On 2012/08/29 22:39:36, Matt Menke wrote: > Erm...Right. Perhaps FinishAttempt should be renamed. I'd just ...
8 years, 3 months ago (2012-08-29 22:40:21 UTC) #17
mmenke
On 2012/08/29 22:40:21, szym wrote: > On 2012/08/29 22:39:36, Matt Menke wrote: > > Erm...Right. ...
8 years, 3 months ago (2012-08-29 22:44:48 UTC) #18
mmenke
On 2012/08/29 22:44:48, Matt Menke wrote: > On 2012/08/29 22:40:21, szym wrote: > > On ...
8 years, 3 months ago (2012-08-29 23:00:59 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/szym@chromium.org/10824238/28003
8 years, 3 months ago (2012-08-30 03:50:29 UTC) #20
szym
Thanks for the thorough review. Adding another test allowed me to catch an infinite loop.
8 years, 3 months ago (2012-08-30 03:52:25 UTC) #21
commit-bot: I haz the power
8 years, 3 months ago (2012-08-30 05:21:04 UTC) #22
Try job failure for 10824238-28003 (retry) on win for step "compile" (clobber
build).
It's a second try, previously, step "compile" failed.
http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win&number...

Powered by Google App Engine
This is Rietveld 408576698