summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Gurun <sgurun@google.com>2012-03-08 18:17:48 -0800
committerThe Android Automerger <android-build@android.com>2012-03-08 20:18:18 -0800
commit3ebc33bd4d29326e0a8cf082b8bc07999ff3a762 (patch)
tree9d7233d41bbad11e794b59717bf85712ef26dd3b
parentcd6821f6d334b60537d6d6d5966765a25b0c5ba0 (diff)
downloadnetd-3ebc33bd4d29326e0a8cf082b8bc07999ff3a762.tar.gz
Do not send extra data the client is not consuming.
Bug:6138617 This is to temporarily fix a problem in netd. In case of an error do not send extra data that the client is not expecting. This causes a netd crash. Change-Id: Iadb375e326577857034c2a7d2e962e4242d4735f
-rw-r--r--DnsProxyListener.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/DnsProxyListener.cpp b/DnsProxyListener.cpp
index 6c09e69f..eeef2de0 100644
--- a/DnsProxyListener.cpp
+++ b/DnsProxyListener.cpp
@@ -76,7 +76,9 @@ void DnsProxyListener::GetAddrInfoHandler::run() {
uint32_t rv = getaddrinfo(mHost, mService, mHints, &result);
if (rv) {
// getaddrinfo failed
- mClient->sendBinaryMsg(ResponseCode::DnsProxyOperationFailed, &rv, sizeof(rv));
+ // TODO This is temporary. We think there is another bug exposed when we send data here, so
+ // temporarily setting it to 0.
+ mClient->sendBinaryMsg(ResponseCode::DnsProxyOperationFailed, &rv, 0);
} else {
bool success = !mClient->sendCode(ResponseCode::DnsProxyQueryResult);
struct addrinfo* ai = result;
@@ -250,9 +252,11 @@ void DnsProxyListener::GetHostByAddrHandler::run() {
hp->h_name ? hp->h_name : "",
hp->h_name ? strlen(hp->h_name)+ 1 : 0);
} else {
+ // TODO This is temporary. We think there is another bug exposed when we send data here, so
+ // temporarily setting it to 0.
uint32_t error = h_errno;
failed = mClient->sendBinaryMsg(ResponseCode::DnsProxyOperationFailed,
- &error, sizeof(error));
+ &error, 0);
}
if (failed) {