Index: blacklistd-helper =================================================================== --- blacklistd-helper +++ blacklistd-helper @@ -16,6 +16,9 @@ break fi done +if [ -f "/etc/ipf.conf" ]; then + pf="ipfilter" +fi if [ -f "/etc/ipfw-blacklist.rc" ]; then pf="ipfw" . /etc/ipfw-blacklist.rc @@ -48,6 +51,10 @@ case "$1" in add) case "$pf" in + ipfilter) + ipfstat -io | ipf -I -f - + echo "block in quick proto $proto from $addr/$mask to any port = $port head $port$6" | ipf -I -f - -s + ;; ipfw) rule=$(( $ipfw_offset + $6 )) # use $ipfw_offset+$port for rule number tname="port$6" @@ -69,6 +76,10 @@ ;; rem) case "$pf" in + ipfilter) + ipfstat -io | ipf -I -f - + echo "block in quick proto $proto from $addr/$mask to any port = $port head port$6" | ipf -r -f - -s + ;; ipfw) /sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null ;; @@ -82,6 +93,9 @@ ;; flush) case "$pf" in + ipfilter) + /sbin/ipf -Z -I -Fa -s + ;; ipfw) /sbin/ipfw table "port$6" flush 2>/dev/null ;;