OSDN Git Service

Only set protectFromVpn if explicitlySelected is also true. nougat-x86 android-x86-7.1-r1 android-x86-7.1-r2 android-x86-7.1-r3 android-x86-7.1-r4 android-x86-7.1-r5
authorErik Kline <ek@google.com>
Thu, 25 May 2017 08:03:31 +0000 (17:03 +0900)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 10 Aug 2017 01:48:06 +0000 (09:48 +0800)
commiteb1e84c5deec7ccb0dfbed04d2c69cd66fba076b
tree799fd1342ffb5682d31509d507138bb561a6176a
parentd3e100d44fa61b6377203bab364bc330471da414
Only set protectFromVpn if explicitlySelected is also true.

When a secure VPN is up, setting protectFromVpn=1 and explicitlySelected=0
causes the probe routing lookups used by _have_ipv4 and _have_ipv6 to skip
the VPN rule, instead selecting the default network.

This means that the address families for which we query DNS records are
determined by the address families of the the default network, not those of
the VPN.

If explicitlySelected==true, setting protectFromVpn=true (if the app can
protect its sockets) results in querying the address families from the
specified network, which is correct.

Test: as follows
    - built
    - flashed
    - booted
    - runtest -x netd_integration_test.cpp passes
    - testing per bug discussion
Bug: 37131664
Bug: 37347238
Change-Id: I7cf322a047494fd70c3c4d8862d53d6a6dac66de
server/NetworkController.cpp
server/NetworkController.h