OSDN Git Service

Always use the default network DNS servers if a VPN does not set any.
authorLorenzo Colitti <lorenzo@google.com>
Tue, 21 Jun 2016 14:54:12 +0000 (23:54 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Wed, 22 Jun 2016 07:39:30 +0000 (16:39 +0900)
commitc63059c8a7423b13cecc8b65885d54c12aae0d10
tree886f85e47740239e296788e83a37d765b5e59a99
parent0452cb569ebeface13f77c548afb35cdfcbe48d5
Always use the default network DNS servers if a VPN does not set any.

When a VPN provides no DNS servers, DNS lookups are usually sent
to the default network's DNS servers. However, if a DNS lookup
is explicitly made on the VPN (e.g., via Network#openConnection),
then it just fails.

This breaks system proxies which perform network traffic on VPNs
on behalf of other apps, e.g., the download manager.

Fix this by doing the query to the default DNS servers (via the
default network) instead. This is consistent with what we do with
DNS queries that do not specify a network. While this is a change
in behaviour, it shouldn't cause much breakage because the query
would previously just fail.

Bug: 29498052
Change-Id: Ie4002c9835bb1ff6d3d92c00c9c04e634fc3cda4
server/NetworkController.cpp