From bf2fb994facf88cb0e77d7b7216b5a7e5dcc23ac Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sun, 2 Feb 2025 22:15:41 +0100 Subject: [PATCH] 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 --- net/banip/Makefile | 2 +- net/banip/files/banip-functions.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/banip/Makefile b/net/banip/Makefile index 2195c97228..cece0d3fb5 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 d9a19a3550..0ada0956b7 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" "---" -- 2.30.2