diff --git a/net/dns/address_sorter_posix.cc b/net/dns/address_sorter_posix.cc index 0f4afb74871c..622d4da49bdd 100644 --- a/net/dns/address_sorter_posix.cc +++ b/net/dns/address_sorter_posix.cc @@ -140,7 +140,13 @@ const AddressSorterPosix::PolicyEntry kDefaultPrecedenceTable[] = { // ::/0 -- any {{}, 0, 40}, // ::ffff:0:0/96 -- IPv4 mapped +#if defined(STARBOARD) + // Cobalt currently prioritizes IPv4 addresses higher, as + // suggested in section 10.3 of RFC3484 + {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF}, 96, 100}, +#else {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF}, 96, 35}, +#endif // 2002::/16 -- 6to4 {{ 0x20, diff --git a/net/dns/address_sorter_posix_unittest.cc b/net/dns/address_sorter_posix_unittest.cc index a4383aefc6a6..4d35ea5479c4 100644 --- a/net/dns/address_sorter_posix_unittest.cc +++ b/net/dns/address_sorter_posix_unittest.cc @@ -386,7 +386,11 @@ TEST_P(AddressSorterPosixSyncOrAsyncTest, Rule6) { AddMapping("2001::1", "2001::10"); // Teredo const char* const addresses[] = {"2001::1", "::ffff:1234:1", "ff32::1", "::1", nullptr}; +#if defined(STARBOARD) + const int order[] = { 1, 3, 2, 0, -1 }; +#else const int order[] = { 3, 2, 1, 0, -1 }; +#endif Verify(addresses, order); }