ddns-scripts: do not verify DNS server on start
authorFlorian Eckert <redacted>
Wed, 15 May 2024 14:31:58 +0000 (16:31 +0200)
committerFlorian Eckert <redacted>
Fri, 17 May 2024 10:39:19 +0000 (12:39 +0200)
When the ddns update script is started, the system checks whether the
configured DNS server can be reached. This is checked with the 'netcat' tool.
The tool tries to establish a TCP connection on port 53 of the configured
DNS server.

The problem with this implementation is, that this call blocks the ddns
update script until 'netcat' returns from the call.

Verfification failed:
If the IP and the port cannot be reached, the netcat call returns
immediately.

Verfification successfull:
If the IP and the port of the DNS server can be reached, the connection
remains established and so the ddns update scripts blocks until the
configured TCP session timeout of the DNS server resets the connection.

The behavior in the event of an successfull verificataion is a problem
for the ddns update script if it is called via the hotplug. Since the ddns
update script runs too long! This blocking behavior also depends on
the TCP session timeout setting of the DNS server.

> time netcat 1.1.1.1 53
netcat 1.1.1.1 53  0.00s user 0.00s system 0% cpu 10.016 total

> time netcat 8.8.8.8 53
netcat 8.8.8.8 53  0.00s user 0.00s system 0% cpu 2.012 total

The TCP session timeout is for 1.1.1.1 10 seconds and for 8.8.8.8 2 seconds.

The '--wait' option of necat or the additional integration of the 'timeout'
function of busybox was implemented for this behavior. But the used '--wait'
function of netcat of the busybox shows no effect here.

Since the used implementation is not clean, the question arise why this
is necessary for the ddns update script at all? As the nslookup throws an
error anyway if it cannot resolve the IP. This check is only informative.
The check does not affect the script behavior.

The check is therefore removed on ddns update.

Signed-off-by: Florian Eckert <redacted>
net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh

index 2524188aa926eeb48ebfa26e8644fd89d8fa26c5..7d44fa07f1ca57aadb167be60217dd420cfce66e 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.8.2
-PKG_RELEASE:=44
+PKG_RELEASE:=45
 
 PKG_LICENSE:=GPL-2.0
 
index 21b0202d375c7c8796e56693368954f9394b642f..e6f91e8ee08f58250b89410ab4dcc7cf2c57394e 100644 (file)
@@ -322,9 +322,6 @@ else
        write_log 7 "last update: $(eval $EPOCH_TIME)"
 fi
 
-# verify DNS server
-[ -n "$dns_server" ] && verify_dns "$dns_server"
-
 # verify Proxy server and set environment
 [ -n "$proxy" ] && {
        verify_proxy "$proxy" && {
git clone https://git.99rst.org/PROJECT