banIP: update 1.5.0-6
authorDirk Brenken <redacted>
Sun, 2 Feb 2025 21:15:41 +0000 (22:15 +0100)
committerDirk Brenken <redacted>
Sun, 2 Feb 2025 21:15:41 +0000 (22:15 +0100)
* fixed  the incomplete rule maintainance during banIP reloads
* fixed the Set query function (if the Set counters are disabled)

Signed-off-by: Dirk Brenken <redacted>
net/banip/Makefile
net/banip/files/banip-functions.sh

index 2195c9722858a0d0f9cda9212e04c6b1d2200330..cece0d3fb5fdca9a17b4ed3b49515010d7e13a25 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=1.5.0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index d9a19a35507593a669c6040cf38f5db1031cdf4c..0ada0956b7ffce5d51d419cb3dcc7b3b6309574c 100644 (file)
@@ -861,7 +861,7 @@ f_down() {
                table_json="$("${ban_nftcmd}" -tja list table inet banIP 2>/dev/null)"
                {
                        for chain in _inbound _outbound; do
-                               for expr in 0 1; do
+                               for expr in 0 1 2; do
                                        handle="$(printf "%s\n" "${table_json}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.chain=\"${chain}\"][@.expr[${expr}].match.right=\"@${feed}\"].handle")"
                                        [ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP ${chain} handle ${handle}"
                                done
@@ -1291,7 +1291,7 @@ f_rmset() {
                                [ -z "${del_set}" ] && del_set="${feed}" || del_set="${del_set}, ${feed}"
                                rm -f "${ban_backupdir}/banIP.${feed}.gz"
                                for chain in _inbound _outbound; do
-                                       for expr in 0 1; do
+                                       for expr in 0 1 2; do
                                                handle="$(printf "%s\n" "${table_json}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.chain=\"${chain}\"][@.expr[${expr}].match.right=\"@${feed}\"].handle")"
                                                [ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP ${chain} handle ${handle}"
                                        done
@@ -1737,7 +1737,7 @@ f_survey() {
                printf "%s\n%s\n%s\n" ":::" "::: no valid survey input" ":::"
                return
        fi
-       set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*].elem.val')"
+       set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]')"
        printf "%s\n%s\n%s\n" ":::" "::: banIP Survey" ":::"
        printf "    %s\n" "List of elements in the Set '${input}' on $(date "+%Y-%m-%d %H:%M:%S")"
        printf "    %s\n" "---"
git clone https://git.99rst.org/PROJECT