blacklistd: Reduce diff with upstream

No functional change intended.
This commit is contained in:
Jose Luis Duran 2022-10-12 16:17:51 -03:00 committed by Ed Maste
parent 226e41467e
commit 1c14656dad

View File

@ -81,7 +81,7 @@ add)
/sbin/pfctl -a "$2/$6" -f -
# insert $ip/$mask into per-protocol/port anchored table
/sbin/pfctl -qa "$2/$6" -t "port$6" -T add "$addr/$mask" && \
/sbin/pfctl -q -k $addr && echo OK
/sbin/pfctl -qk "$addr" && echo OK
;;
esac
;;
@ -119,8 +119,7 @@ flush)
;;
pf)
# dynamically determine which anchors exist
anchors=$(/sbin/pfctl -a $2 -s Anchors)
for anchor in $anchors; do
for anchor in $(/sbin/pfctl -a "$2" -s Anchors); do
/sbin/pfctl -a $anchor -t "port${anchor##*/}" -T flush
/sbin/pfctl -a $anchor -F rules
done