banip: fix housekeeping
authorDirk Brenken <dev@brenken.org>
Fri, 23 Apr 2021 13:03:53 +0000 (15:03 +0200)
committerDirk Brenken <dev@brenken.org>
Fri, 23 Apr 2021 15:46:29 +0000 (17:46 +0200)
* fix whitelist housekeeping if you switch between normal- and
  'whitelist only' mode

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 7cfb0f4657dea6a7844df28268e7e8af6eb00db4)

net/banip/Makefile
net/banip/files/banip.sh

index b7fc044c8992447bc116d449a14e95ab4e33c5ae..4ae1b2339546d73824773cedc8acd0a325011e39 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=0.7.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index ed808529dbbf15eb76c4b402b17a4558f55e1c6b..816f2c3487812b50f1621d1426fa626c006f1c00 100755 (executable)
@@ -548,14 +548,12 @@ f_iptables()
                                f_iptrule "-D" "${ban_chain}" "-o ${dev} -m set --match-set ${src_name} src -j RETURN"
                        elif [ "${src_name%_*}" = "whitelist" ]
                        then
-                               if [ "${ban_whitelistonly}" = "1" ]
-                               then
-                                       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}"
-                               else
-                                       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"
-                               fi
+                               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}"
+                               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}"