summaryrefslogtreecommitdiffstats
path: root/libc/dns/net
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2014-05-29 16:28:30 -0400
committerPaul Jensen <pauljensen@google.com>2014-05-30 08:02:52 -0400
commit31ad03761d35ce5bff48cc1cb3764816727ac1f0 (patch)
treee49e0d4b6f4fbd2980c72c49ec79e9b0796d9d5c /libc/dns/net
parent0f1a221b3a83cd135e6228462d48c3b983329837 (diff)
downloadbionic-31ad03761d35ce5bff48cc1cb3764816727ac1f0.zip
bionic-31ad03761d35ce5bff48cc1cb3764816727ac1f0.tar.gz
bionic-31ad03761d35ce5bff48cc1cb3764816727ac1f0.tar.bz2
Make host resolver call __connect() rather than connect() so mark isn't cleared.
Calling connect() will erase the mark set by the host resolver code because the explicitlySelected bit of the Fwmark isn't set. It's by design that the explicitlySelected bit isn't set as this facilitates falling through to other routing rules if the selected network doesn't provide a route to the DNS server as may be the case with VPNs. Change-Id: I60ba7c754194ead97df3ac6a6c5b3db1f446dac8
Diffstat (limited to 'libc/dns/net')
-rw-r--r--libc/dns/net/getaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c
index be692e3..32d946c 100644
--- a/libc/dns/net/getaddrinfo.c
+++ b/libc/dns/net/getaddrinfo.c
@@ -369,7 +369,7 @@ _test_connect(int pf, struct sockaddr *addr, size_t addrlen, unsigned mark) {
return 0;
int ret;
do {
- ret = connect(s, addr, addrlen);
+ ret = __connect(s, addr, addrlen);
} while (ret < 0 && errno == EINTR);
int success = (ret == 0);
do {
@@ -1803,7 +1803,7 @@ _find_src_addr(const struct sockaddr *addr, struct sockaddr *src_addr, unsigned
if (mark != MARK_UNSET && setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0)
return 0;
do {
- ret = connect(sock, addr, len);
+ ret = __connect(sock, addr, len);
} while (ret == -1 && errno == EINTR);
if (ret == -1) {