<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 28, 2020 at 5:20 PM Petr Štetiar <<a href="mailto:ynezz@true.cz">ynezz@true.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Init script checks for an already active DHCP server on the interface<br>
and if such DHCP server is found, then it logs "refusing to start DHCP"<br>
message, starts dnsmasq without DHCP service unless `option force 1` is<br>
set and caches the DHCP server check result.<br>
<br>
Each consecutive service start then uses this cached DHCP server check<br>
result, but doesn't provide log feedback about disabled DHCP service<br>
anymore.<br>
<br>
So this patch ensures, that the log message about disabled DHCP service<br>
on particular interface is always provided.<br>
<br>
Signed-off-by: Petr Štetiar <<a href="mailto:ynezz@true.cz" target="_blank">ynezz@true.cz</a>><br></blockquote><div>Acked-by: Hans Dedecker <<a href="mailto:dedeckeh@gmail.com">dedeckeh@gmail.com</a>> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
package/network/services/dnsmasq/files/dnsmasq.init | 12 ++++++------<br>
1 file changed, 6 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init<br>
index 1051087e05a6..9288971426ae 100644<br>
--- a/package/network/services/dnsmasq/files/dnsmasq.init<br>
+++ b/package/network/services/dnsmasq/files/dnsmasq.init<br>
@@ -110,11 +110,6 @@ dhcp_check() {<br>
<br>
udhcpc -n -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0<br>
<br>
- [ $rv -eq 1 ] && \<br>
- logger -t dnsmasq \<br>
- "found already running DHCP-server on interface '$ifname'" \<br>
- "refusing to start, use 'option force 1' to override"<br>
-<br>
echo $rv > "$stamp"<br>
return $rv<br>
}<br>
@@ -517,7 +512,12 @@ dhcp_add() {<br>
<br>
#check for an already active dhcp server on the interface, unless 'force' is set<br>
config_get_bool force "$cfg" force 0<br>
- [ $force -gt 0 ] || dhcp_check "$ifname" || return 0<br>
+ [ $force -gt 0 ] || dhcp_check "$ifname" || {<br>
+ logger -t dnsmasq \<br>
+ "found already running DHCP-server on interface '$ifname'" \<br>
+ "refusing to start, use 'option force 1' to override"<br>
+ return 0<br>
+ }<br>
<br>
config_get start "$cfg" start 100<br>
config_get limit "$cfg" limit 150<br>
<br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div></div>