Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions root/sbin/fw4
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ start() {

ACTION=includes \
utpl -S $MAIN
[ -n "$CTFLUSH" ] && echo f > /proc/net/nf_conntrack
} 1000>$LOCK
}

Expand All @@ -59,11 +60,9 @@ flush() {
{
flock -x 1000

local dummy family table
nft list tables | while read dummy family table; do
nft delete table "$family" "$table"
done

nft add table inet fw4
nft delete table inet fw4
echo f > /proc/net/nf_conntrack
rm -f $STATE
} 1000>$LOCK
}
Expand Down Expand Up @@ -95,7 +94,11 @@ while [ -n "$1" ]; do
done

case "$1" in
start|reload)
start)
nft 'create table inet fw4' 2>/dev/null && export CTFLUSH=1
start "$1"
;;
reload)
start "$1"
;;
stop)
Expand Down