From 706cad572c624c0691220ff81f09ca6d149d323d Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Tue, 18 Feb 2025 00:13:29 +0000 Subject: [PATCH] https-dns-proxy: bugfixes * No more `/sbin/uci: Invalid argument output` when set to not update dnsmasq instances (thanks @tmcqueen-materials for investigation!) * Do not wait for interface.up on boot, hopefully this resolves the boot-up start for everyone Signed-off-by: Stan Grishin --- net/https-dns-proxy/Makefile | 2 +- net/https-dns-proxy/files/etc/init.d/https-dns-proxy | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/https-dns-proxy/Makefile b/net/https-dns-proxy/Makefile index 454ab9e1d9..2150c8e7ff 100644 --- a/net/https-dns-proxy/Makefile +++ b/net/https-dns-proxy/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=https-dns-proxy PKG_VERSION:=2023.12.26 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/ diff --git a/net/https-dns-proxy/files/etc/init.d/https-dns-proxy b/net/https-dns-proxy/files/etc/init.d/https-dns-proxy index a061ad09c4..d04ed7376f 100755 --- a/net/https-dns-proxy/files/etc/init.d/https-dns-proxy +++ b/net/https-dns-proxy/files/etc/init.d/https-dns-proxy @@ -33,6 +33,7 @@ readonly canaryDomainsiCloud='mask.icloud.com mask-h2.icloud.com' hdp_boot_flag= dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; } +is_alnum() { case "$1" in (*[![:alnum:]_@]*|"") return 1;; esac; } is_fw4_restart_needed() { [ "$(uci_get "$packageName" 'config' 'force_dns' '1')" = '1' ]; } is_mac_address() { expr "$1" : '[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]$' >/dev/null; } is_ipv4() { expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; } @@ -133,7 +134,7 @@ append_bootstrap() { } boot() { - ubus -t 30 wait_for network.interface 2>/dev/null +# ubus -t 30 wait_for network.interface 2>/dev/null rc_procd start_service 'on_boot' && service_started 'on_boot' if ! is_resolver_working; then hdp_boot_flag=1 @@ -168,7 +169,7 @@ start_instance() { config_load 'dhcp' config_foreach dnsmasq_doh_server 'dnsmasq' 'add' "${listen_addr}" "${listen_port}" config_foreach dnsmasq_instance_append_force_dns_port 'dnsmasq' - elif [ -n "$dnsmasq_config_update" ]; then + elif is_alnum "$dnsmasq_config_update"; then for i in $dnsmasq_config_update; do dnsmasq_doh_server "@dnsmasq[$i]" 'add' "${listen_addr}" "${listen_port}" || \ dnsmasq_doh_server "${i}" 'add' "${listen_addr}" "${listen_port}" -- 2.30.2