From ad6c7384e4a7a2103e5f3290a8aab4890b8ca2fd Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 2 Jul 2018 16:19:58 +0000 Subject: [PATCH] dnsmasq: second part of slurp rework Align this code with Unbound, slowly ridding ourselves of get_possible_listen_ips() in the process as well. PR: https://twitter.com/wget42/status/1009886764155260928 --- src/etc/inc/plugins.inc.d/dnsmasq.inc | 16 ++++++---------- src/www/services_dnsmasq.php | 15 +++++---------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/dnsmasq.inc b/src/etc/inc/plugins.inc.d/dnsmasq.inc index 778771585..f8f0b8afa 100644 --- a/src/etc/inc/plugins.inc.d/dnsmasq.inc +++ b/src/etc/inc/plugins.inc.d/dnsmasq.inc @@ -118,18 +118,14 @@ function dnsmasq_configure_do($verbose = false) } if (isset($config['dnsmasq']['interface'])) { - $addresses = array(); + $addresses = array('127.0.0.1', '::1'); foreach (explode(',', $config['dnsmasq']['interface']) as $interface) { - if (is_ipaddrv4($interface)) { - $addresses[] = $interface; - } elseif (is_ipaddrv6($interface)) { - /* no support for link-local address with scope specified */ - $addresses[] = explode("%", $interface)[0]; - } else { - foreach (legacy_getall_interface_addresses(get_real_interface($$interface)) as $tmpaddr) { - $tmpaddr = explode('/', $tmpaddr)[0]; - $tmpaddr = explode('%', $tmpaddr)[0]; + foreach (legacy_getall_interface_addresses(get_real_interface($interface)) as $tmpaddr) { + $tmpaddr = explode('/', $tmpaddr)[0]; + /* no support for link-local address with scope specified */ + $tmpaddr = explode('%', $tmpaddr)[0]; + if (!empty($tmpaddr)) { $addresses[] = $tmpaddr; } } diff --git a/src/www/services_dnsmasq.php b/src/www/services_dnsmasq.php index 45d765e6a..c358a9e0c 100644 --- a/src/www/services_dnsmasq.php +++ b/src/www/services_dnsmasq.php @@ -349,17 +349,12 @@ $( document ).ready(function() { - + $ifacename): ?> + - - - +