summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2015-10-29 15:15:09 -0700
committerRoshan Pius <rpius@google.com>2015-10-30 08:37:24 -0700
commitb265d6f2a9a7e2aad83bb0845aab56474d09a3cf (patch)
tree44fc7ddae73c3a5bbb343d69fa9486e7ae207f76
parentb955ca6befab20bc858dcaa6dc1f7f081725f2ac (diff)
downloadandroid_external_dnsmasq-b265d6f2a9a7e2aad83bb0845aab56474d09a3cf.tar.gz
android_external_dnsmasq-b265d6f2a9a7e2aad83bb0845aab56474d09a3cf.tar.bz2
android_external_dnsmasq-b265d6f2a9a7e2aad83bb0845aab56474d09a3cf.zip
dnsmasq: Disable DNS server updation via STDIN on Brillo.
Brillo starts dnsmasq with STDIN redirected to /dev/null and we don't need the feature to update the DNS servers via STDIN. So, disabling the feature (commit id: 33b34445) for Brillo devices. BUG: 25193399 TEST: Manual tests below: 1. Bootstrapped Edison and connected to a Wifi AP. 2. Verified the `top` output to ensure that dnsmasq wasn't hogging CPU. 3. Verified via `strace` that dnsmasq is no longer listening to /dev/null. Change-Id: Ibc7c671a933904471b76ac6ce20f8490c9b0856c
-rwxr-xr-xsrc/dnsmasq.c12
-rwxr-xr-xsrc/dnsmasq.h2
-rwxr-xr-xsrc/network.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 2f0fbb6..52d222e 100755
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -64,7 +64,7 @@ static void sig_handler(int sig);
static void async_event(int pipe, time_t now);
static void fatal_event(struct event_desc *ev);
static void poll_resolv(void);
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__BRILLO__)
static int set_android_listeners(fd_set *set, int *maxfdp);
static int check_android_listeners(fd_set *set);
#endif
@@ -282,7 +282,7 @@ int main (int argc, char **argv)
if (!(daemon->options & OPT_DEBUG))
{
-#ifndef __ANDROID__
+#if !defined(__ANDROID__) || defined(__BRILLO__)
int nullfd;
#endif
@@ -351,7 +351,7 @@ int main (int argc, char **argv)
}
}
-#ifndef __ANDROID__
+#if !defined(__ANDROID__) || defined(__BRILLO__)
/* open stdout etc to /dev/null */
nullfd = open("/dev/null", O_RDWR);
dup2(nullfd, STDOUT_FILENO);
@@ -591,7 +591,7 @@ int main (int argc, char **argv)
t.tv_usec = 0;
tp = &t;
}
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__BRILLO__)
set_android_listeners(&rset, &maxfd);
#endif
@@ -686,7 +686,7 @@ int main (int argc, char **argv)
check_dbus_listeners(&rset, &wset, &eset);
#endif
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__BRILLO__)
check_android_listeners(&rset);
#endif
@@ -981,7 +981,7 @@ void clear_cache_and_reload(time_t now)
#endif
}
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__BRILLO__)
static int set_android_listeners(fd_set *set, int *maxfdp) {
FD_SET(STDIN_FILENO, set);
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index 0b9dbd2..9d8c6dc 100755
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -781,7 +781,7 @@ int local_bind(int fd, union mysockaddr *addr, char *intname, uint32_t mark, int
int random_sock(int family);
void pre_allocate_sfds(void);
int reload_servers(char *fname);
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__BRILLO__)
int set_servers(const char *servers);
void set_interfaces(const char *interfaces);
#endif
diff --git a/src/network.c b/src/network.c
index c7431df..9ae9037 100755
--- a/src/network.c
+++ b/src/network.c
@@ -916,7 +916,7 @@ void check_servers(void)
daemon->servers = ret;
}
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__BRILLO__)
/* #define __ANDROID_DEBUG__ 1 */
/*
* Ingests a new list of interfaces and starts to listen on them, adding only the new