]> git.99rst.org Git - openwrt-packages.git/commitdiff
adblock: keep the GeoIP map usable without a local uplink
authorDirk Brenken <redacted>
Sun, 26 Jul 2026 19:53:09 +0000 (21:53 +0200)
committerDirk Brenken <redacted>
Sun, 26 Jul 2026 19:53:09 +0000 (21:53 +0200)
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 <redacted>
net/adblock/Makefile
net/adblock/files/adblock.sh

index 0be2f8419dacf086ecbe04f6713fc3c7dc33e17b..5fc34f2ba30e3333f68f19b945853a60267193cf 100644 (file)
@@ -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 <dev@brenken.org>
 
index 69033e2238ca9e25fb0d711c82fd1a5f1e5a6504..4b0daff1b05a0aad2fe466fe0d61bb3127f015ff 100755 (executable)
@@ -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
git clone https://git.99rst.org/PROJECT