summaryrefslogtreecommitdiff
path: root/src/dnsmasq
diff options
context:
space:
mode:
authorEric Renfro <psi-jack@linux-help.org>2018-06-29 21:43:52 -0400
committerLubomir Rintel <lkundrak@v3.sk>2018-06-30 11:56:37 +0200
commitb4116a6fe6a5cfc05c0b81f71dd44b59c7ca0c43 (patch)
tree6f03167c8b4ee341633ed5802327694cc03e577c /src/dnsmasq
parent7f2b7ee4cdd6dfe21e73e5a7113759c400321749 (diff)
downloadNetworkManager-b4116a6fe6a5cfc05c0b81f71dd44b59c7ca0c43.tar.gz
dnsmasq: fix separation from system-wide dnsmasq
This disables loading the system-wide dnsmasq from /etc/dnsmasq.conf and defines to use the NMSTATEDIR device-unique dhcp-leasefile, preventing it from trampling over others, and isolating it to just the wifi-ap use. https://github.com/NetworkManager/NetworkManager/pull/156
Diffstat (limited to 'src/dnsmasq')
-rw-r--r--src/dnsmasq/nm-dnsmasq-manager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dnsmasq/nm-dnsmasq-manager.c b/src/dnsmasq/nm-dnsmasq-manager.c
index 041e75ea4f..33848c20d7 100644
--- a/src/dnsmasq/nm-dnsmasq-manager.c
+++ b/src/dnsmasq/nm-dnsmasq-manager.c
@@ -187,7 +187,7 @@ create_dm_cmd_line (const char *iface,
* as the gateway or whatever. So tell dnsmasq not to use any config file
* at all.
*/
- nm_cmd_line_add_string (cmd, "--conf-file");
+ nm_cmd_line_add_string (cmd, "--conf-file=/dev/null");
nm_cmd_line_add_string (cmd, "--no-hosts");
nm_cmd_line_add_string (cmd, "--keep-in-foreground");
@@ -249,6 +249,11 @@ create_dm_cmd_line (const char *iface,
nm_cmd_line_add_string (cmd, "--dhcp-lease-max=50");
+ g_string_append (s, "--dhcp-leasefile=" NMSTATEDIR);
+ g_string_append_printf (s, "/dnsmasq-%s.leases", iface);
+ nm_cmd_line_add_string (cmd, s->str);
+ g_string_truncate (s, 0);
+
g_string_append (s, "--pid-file=");
g_string_append (s, pidfile);
nm_cmd_line_add_string (cmd, s->str);