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 <nbd@nbd.name>
This commit is contained in:
parent
712b6fdc5c
commit
6916ca8d33
1 changed files with 6 additions and 0 deletions
|
@ -64,6 +64,12 @@ dhcp_check() {
|
||||||
|
|
||||||
[ -s "$stamp" ] && return $(cat "$stamp")
|
[ -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
|
udhcpc -n -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0
|
||||||
|
|
||||||
[ $rv -eq 1 ] && \
|
[ $rv -eq 1 ] && \
|
||||||
|
|
Loading…
Reference in a new issue