aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2020-04-28 17:00:58 +0200
committerPetr Štetiar <ynezz@true.cz>2020-04-30 00:52:04 +0200
commitb17a5a9bdb9f6f5ff73ceee0265b3f5de943d1bb (patch)
treeaa33ba48934df008946c8a6496ef564f4ac1f4bb /package/network
parentaa0526b5f27c9c9edad719dd9c521ef4dae10a00 (diff)
downloadupstream-b17a5a9bdb9f6f5ff73ceee0265b3f5de943d1bb.tar.gz
upstream-b17a5a9bdb9f6f5ff73ceee0265b3f5de943d1bb.tar.bz2
upstream-b17a5a9bdb9f6f5ff73ceee0265b3f5de943d1bb.zip
dnsmasq: always inform about disabled dhcp service
Init script checks for an already active DHCP server on the interface and if such DHCP server is found, then it logs "refusing to start DHCP" message, starts dnsmasq without DHCP service unless `option force 1` is set and caches the DHCP server check result. Each consecutive service start then uses this cached DHCP server check result, but doesn't provide log feedback about disabled DHCP service anymore. So this patch ensures, that the log message about disabled DHCP service on particular interface is always provided. Acked-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init12
1 files changed, 6 insertions, 6 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 1051087e05..9288971426 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -110,11 +110,6 @@ dhcp_check() {
udhcpc -n -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0
- [ $rv -eq 1 ] && \
- logger -t dnsmasq \
- "found already running DHCP-server on interface '$ifname'" \
- "refusing to start, use 'option force 1' to override"
-
echo $rv > "$stamp"
return $rv
}
@@ -517,7 +512,12 @@ dhcp_add() {
#check for an already active dhcp server on the interface, unless 'force' is set
config_get_bool force "$cfg" force 0
- [ $force -gt 0 ] || dhcp_check "$ifname" || return 0
+ [ $force -gt 0 ] || dhcp_check "$ifname" || {
+ logger -t dnsmasq \
+ "found already running DHCP-server on interface '$ifname'" \
+ "refusing to start, use 'option force 1' to override"
+ return 0
+ }
config_get start "$cfg" start 100
config_get limit "$cfg" limit 150