summaryrefslogtreecommitdiffstats
path: root/src/dnsmasq.c
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2012-12-11 12:42:32 -0800
committerRobert Greenwalt <rgreenwalt@google.com>2012-12-14 16:27:51 -0800
commit41cd7ed80eb5e97ef9893633d05f0877da7d6d0c (patch)
treec4be728e422e1aebc5d339b63d9f67bb21afa6b8 /src/dnsmasq.c
parent758fb6cde3ee6ab53aa6b4b07a2acc2bde0b6c5d (diff)
downloadandroid_external_dnsmasq-41cd7ed80eb5e97ef9893633d05f0877da7d6d0c.tar.gz
android_external_dnsmasq-41cd7ed80eb5e97ef9893633d05f0877da7d6d0c.tar.bz2
android_external_dnsmasq-41cd7ed80eb5e97ef9893633d05f0877da7d6d0c.zip
Only listen on the given interfaces.
Stop being a public dns forwarder on our external interfaces. bug:7530468 Change-Id: Ic94cd66e66371de4fcc54f53b9f267f6611804b8
Diffstat (limited to 'src/dnsmasq.c')
-rwxr-xr-xsrc/dnsmasq.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index f6b371a..2f0fbb6 100755
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -390,6 +390,9 @@ int main (int argc, char **argv)
/* On linux, we keep CAP_NETADMIN (for ARP-injection) and
CAP_NET_RAW (for icmp) if we're doing dhcp */
data->effective = data->permitted = data->inheritable =
+#ifdef __ANDROID__
+ (1 << CAP_NET_BIND_SERVICE) |
+#endif
(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) | (1 << CAP_SETUID);
/* Tell kernel to not clear capabilities when dropping root */
@@ -433,6 +436,9 @@ int main (int argc, char **argv)
#ifdef HAVE_LINUX_NETWORK
data->effective = data->permitted =
+#ifdef __ANDROID__
+ (1 << CAP_NET_BIND_SERVICE) |
+#endif
(1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW);
data->inheritable = 0;
@@ -1010,6 +1016,13 @@ static int check_android_listeners(fd_set *set) {
my_syslog(LOG_ERR, _("Malformatted msg '%s'"), current_cmd);
retcode = -1;
}
+ } else if (!strcmp(cmd, "update_ifaces")) {
+ if (params != NULL) {
+ set_interfaces(params);
+ } else {
+ my_syslog(LOG_ERR, _("Malformatted msg '%s'"), current_cmd);
+ retcode = -1;
+ }
} else {
my_syslog(LOG_ERR, _("Unknown cmd '%s'"), cmd);
retcode = -1;
@@ -1344,5 +1357,3 @@ int icmp_ping(struct in_addr addr)
return gotreply;
}
#endif
-
-