From 0bcf4cab80fc81e77db9012bd6c76318f04a4fa0 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sun, 26 Jul 2026 21:53:09 +0200 Subject: [PATCH] adblock: keep the GeoIP map usable without a local uplink The map array anchor and the f_fetch call were placed inside the uplink branch, so a WAN interface without a resolvable address left adb_map.jsn empty. That skipped the blocked domain lookup as well and dropped the entire map, not just the local marker. Signed-off-by: Dirk Brenken --- net/adblock/Makefile | 2 +- net/adblock/files/adblock.sh | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/net/adblock/Makefile b/net/adblock/Makefile index 0be2f8419d..5fc34f2ba3 100644 --- a/net/adblock/Makefile +++ b/net/adblock/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock PKG_VERSION:=4.5.6 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh index 69033e2238..4b0daff1b0 100755 --- a/net/adblock/files/adblock.sh +++ b/net/adblock/files/adblock.sh @@ -2393,10 +2393,8 @@ f_report() { cnt="1" network_find_wan iface_v4 && network_get_ipaddr ip_v4 "${iface_v4}" network_find_wan6 iface_v6 && network_get_ipaddr6 ip_v6 "${iface_v6}" - if [ -n "${ip_v4}" ] || [ -n "${ip_v6}" ]; then - f_fetch - printf '%s' ",[{}" >"${map_jsn}" - fi + f_fetch + printf '%s' ",[{}" >"${map_jsn}" for ip in ${ip_v4} ${ip_v6}; do ( "${adb_fetchcmd}" ${adb_geoparm} "${adb_geourl}/${ip}" 2>>"${adb_errorlog}" | @@ -2406,7 +2404,7 @@ f_report() { cnt="$((cnt + 1))" done wait - if [ -s "${map_jsn}" ] && [ "${cnt}" -lt "45" ]; then + if [ "${cnt}" -lt "45" ]; then map_seen="" json_init if json_load_file "${report_jsn}" >/dev/null 2>&1; then