summaryrefslogtreecommitdiffstats
path: root/libc/netbsd
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-02-21 21:22:54 -0800
committerNick Kralevich <nnk@google.com>2013-02-21 21:34:11 -0800
commitbfe0640e41204ccc090c364e02675de10d87c923 (patch)
treedaa3d3eff916fb7fc14aa924a70312c85a90468f /libc/netbsd
parent7dfc6a3cd178281c1005a94e84ce5359b23e612f (diff)
downloadbionic-bfe0640e41204ccc090c364e02675de10d87c923.zip
bionic-bfe0640e41204ccc090c364e02675de10d87c923.tar.gz
bionic-bfe0640e41204ccc090c364e02675de10d87c923.tar.bz2
Don't pass pid to dnsproxyd
dnsproxyd can already determine our pid by looking at our socket connection. It's dangerous (and unneeded) to pass it ourselves. Change-Id: I2596d02e361b302259ddb084be2fb75be59889c5
Diffstat (limited to 'libc/netbsd')
-rw-r--r--libc/netbsd/gethnamaddr.c7
-rw-r--r--libc/netbsd/net/getaddrinfo.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/libc/netbsd/gethnamaddr.c b/libc/netbsd/gethnamaddr.c
index 1ab987e..04b1f54 100644
--- a/libc/netbsd/gethnamaddr.c
+++ b/libc/netbsd/gethnamaddr.c
@@ -756,8 +756,7 @@ gethostbyname_internal(const char *name, int af, res_state res, const char *ifac
/* This is writing to system/netd/DnsProxyListener.cpp and changes
* here need to be matched there */
- if (fprintf(proxy, "gethostbyname %d %s %s %d",
- getpid(),
+ if (fprintf(proxy, "gethostbyname %s %s %d",
iface == NULL ? "^" : iface,
name == NULL ? "^" : name,
af) < 0) {
@@ -791,8 +790,8 @@ android_gethostbyaddrforiface_proxy(const void *addr,
const char * addrStr = inet_ntop(af, addr, buf, sizeof(buf));
if (addrStr == NULL) goto exit;
- if (fprintf(proxy, "gethostbyaddr %s %d %d %d %s",
- addrStr, len, af, getpid(), iface == NULL ? "^" : iface) < 0) {
+ if (fprintf(proxy, "gethostbyaddr %s %d %d %s",
+ addrStr, len, af, iface == NULL ? "^" : iface) < 0) {
goto exit;
}
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c
index aed6b94..896055d 100644
--- a/libc/netbsd/net/getaddrinfo.c
+++ b/libc/netbsd/net/getaddrinfo.c
@@ -446,15 +446,14 @@ android_getaddrinfo_proxy(
// Send the request.
proxy = fdopen(sock, "r+");
- if (fprintf(proxy, "getaddrinfo %s %s %d %d %d %d %s %d",
+ if (fprintf(proxy, "getaddrinfo %s %s %d %d %d %d %s",
hostname == NULL ? "^" : hostname,
servname == NULL ? "^" : servname,
hints == NULL ? -1 : hints->ai_flags,
hints == NULL ? -1 : hints->ai_family,
hints == NULL ? -1 : hints->ai_socktype,
hints == NULL ? -1 : hints->ai_protocol,
- iface == NULL ? "^" : iface,
- getpid()) < 0) {
+ iface == NULL ? "^" : iface) < 0) {
goto exit;
}
// literal NULL byte at end, required by FrameworkListener