From 86a20c79556284807f95aafd4f9db9633fafe5b7 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sat, 3 Apr 2021 19:16:39 +0200 Subject: [PATCH] banip: bugfix 0.7.6-2 * fix housekeeping of external list sources Signed-off-by: Dirk Brenken --- net/banip/Makefile | 2 +- net/banip/files/banip.sh | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/net/banip/Makefile b/net/banip/Makefile index a716d4c344..9f0a86540b 100644 --- a/net/banip/Makefile +++ b/net/banip/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=banip PKG_VERSION:=0.7.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/banip/files/banip.sh b/net/banip/files/banip.sh index 04812420af..5e80ee291f 100755 --- a/net/banip/files/banip.sh +++ b/net/banip/files/banip.sh @@ -542,22 +542,18 @@ f_iptables() then for dev in ${ban_ipdevs} do - if [ ! -f "${ban_tmpfile}.${src_name}.delete" ] + if [ "${src_name}" = "maclist" ] then - > "${ban_tmpfile}.${src_name}.delete" - if [ "${src_name}" = "maclist" ] - then - f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} src -j RETURN" - elif [ "${src_name%_*}" = "whitelist" ] - then - f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j RETURN" - f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j RETURN" - else - f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logtarget_src}" - f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logtarget_dst}" - f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logchain_src}" - f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logchain_dst}" - fi + f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} src -j RETURN" + elif [ "${src_name%_*}" = "whitelist" ] + then + f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j RETURN" + f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j RETURN" + else + f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logtarget_src}" + f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logtarget_dst}" + f_iptrule "-D" "${ban_chain}" "-i ${dev} -m set --match-set ${src_name} src -j ${ban_logchain_src}" + f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} dst -j ${ban_logchain_dst}" fi done fi -- 2.30.2