From: Dirk Brenken Date: Sun, 2 Feb 2025 21:15:41 +0000 (+0100) Subject: banIP: update 1.5.0-6 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=bf2fb994facf88cb0e77d7b7216b5a7e5dcc23ac;p=openwrt-packages.git banIP: update 1.5.0-6 * fixed the incomplete rule maintainance during banIP reloads * fixed the Set query function (if the Set counters are disabled) Signed-off-by: Dirk Brenken --- diff --git a/net/banip/Makefile b/net/banip/Makefile index 2195c9722..cece0d3fb 100644 --- a/net/banip/Makefile +++ b/net/banip/Makefile @@ -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 diff --git a/net/banip/files/banip-functions.sh b/net/banip/files/banip-functions.sh index d9a19a355..0ada0956b 100644 --- a/net/banip/files/banip-functions.sh +++ b/net/banip/files/banip-functions.sh @@ -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" "---"