From b4116a6fe6a5cfc05c0b81f71dd44b59c7ca0c43 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Fri, 29 Jun 2018 21:43:52 -0400 Subject: [PATCH] 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 --- src/dnsmasq/nm-dnsmasq-manager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);