From: Felix Fietkau Date: Fri, 29 Jul 2016 12:26:55 +0000 (+0200) Subject: dnsmasq: make the check for existing DHCP servers more reliable X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=6916ca8d33db0ab11434a8fb45f72abd70065c5e;p=openwrt%2Fopenwrt.git dnsmasq: make the check for existing DHCP servers more reliable If there is no carrier yet, wait for 2 seconds (STP forwarding delay) Signed-off-by: Felix Fietkau --- diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 3809e6c119..0941f87fa8 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -64,6 +64,12 @@ dhcp_check() { [ -s "$stamp" ] && return $(cat "$stamp") + # If there's no carrier yet, skip this interface. + # The init script will be called again once the link is up + case "$(devstatus "$ifname" | jsonfilter -e @.carrier)" in + false) return 1;; + esac + udhcpc -n -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0 [ $rv -eq 1 ] && \