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

Side by Side Diff: net/dns/dns_response.cc

Issue 10855163: Revert 151586 - [net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RF… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/dns/dns_response.h ('k') | net/dns/dns_response_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/dns/dns_response.h" 5 #include "net/dns/dns_response.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/sys_byteorder.h" 8 #include "base/sys_byteorder.h"
9 #include "net/base/address_list.h" 9 #include "net/base/address_list.h"
10 #include "net/base/big_endian.h" 10 #include "net/base/big_endian.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } else { 273 } else {
274 if (addr_ttl_sec != record.ttl) 274 if (addr_ttl_sec != record.ttl)
275 return DNS_ADDRESS_TTL_MISMATCH; 275 return DNS_ADDRESS_TTL_MISMATCH;
276 } 276 }
277 ip_addresses.push_back(IPAddressNumber(record.rdata.begin(), 277 ip_addresses.push_back(IPAddressNumber(record.rdata.begin(),
278 record.rdata.end())); 278 record.rdata.end()));
279 } 279 }
280 } 280 }
281 281
282 // TODO(szym): Extract TTL for NODATA results. http://crbug.com/115051 282 // TODO(szym): Extract TTL for NODATA results. http://crbug.com/115051
283 if (ip_addresses.empty())
284 return DNS_NO_ADDRESSES;
283 285
284 // getcanonname in eglibc returns the first owner name of an A or AAAA RR. 286 // getcanonname in eglibc returns the first owner name of an A or AAAA RR.
285 // If the response passed all the checks so far, then |expected_name| is it. 287 // If the response passed all the checks so far, then |expected_name| is it.
286 *addr_list = AddressList::CreateFromIPAddressList(ip_addresses, 288 *addr_list = AddressList::CreateFromIPAddressList(ip_addresses,
287 expected_name); 289 expected_name);
288 *ttl = base::TimeDelta::FromSeconds(std::min(cname_ttl_sec, addr_ttl_sec)); 290 *ttl = base::TimeDelta::FromSeconds(std::min(cname_ttl_sec, addr_ttl_sec));
289 return DNS_PARSE_OK; 291 return DNS_SUCCESS;
290 } 292 }
291 293
292 } // namespace net 294 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_response.h ('k') | net/dns/dns_response_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698