|
@ -1251,34 +1251,21 @@ mwan3_report_rules_v6() |
|
|
|
|
|
|
|
|
mwan3_flush_conntrack() |
|
|
mwan3_flush_conntrack() |
|
|
{ |
|
|
{ |
|
|
local flush_conntrack |
|
|
|
|
|
|
|
|
local interface="$1" |
|
|
|
|
|
local action="$2" |
|
|
|
|
|
|
|
|
config_get flush_conntrack $1 flush_conntrack never |
|
|
|
|
|
|
|
|
handle_flush() { |
|
|
|
|
|
local flush_conntrack="$1" |
|
|
|
|
|
local action="$2" |
|
|
|
|
|
|
|
|
|
|
|
if [ "$action" = "$flush_conntrack" ]; then |
|
|
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
|
|
$LOG info "Connection tracking flushed for interface '$interface' on action '$action'" |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if [ -e "$CONNTRACK_FILE" ]; then |
|
|
if [ -e "$CONNTRACK_FILE" ]; then |
|
|
case $flush_conntrack in |
|
|
|
|
|
ifup) |
|
|
|
|
|
[ "$3" = "ifup" ] && { |
|
|
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
|
|
$LOG info "connection tracking flushed on interface $1 ($2) $3" |
|
|
|
|
|
} |
|
|
|
|
|
;; |
|
|
|
|
|
ifdown) |
|
|
|
|
|
[ "$3" = "ifdown" ] && { |
|
|
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
|
|
$LOG info "connection tracking flushed on interface $1 ($2) $3" |
|
|
|
|
|
} |
|
|
|
|
|
;; |
|
|
|
|
|
always) |
|
|
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
|
|
$LOG info "connection tracking flushed on interface $1 ($2) $3" |
|
|
|
|
|
;; |
|
|
|
|
|
never) |
|
|
|
|
|
$LOG info "connection tracking not flushed on interface $1 ($2) $3" |
|
|
|
|
|
;; |
|
|
|
|
|
esac |
|
|
|
|
|
else |
|
|
|
|
|
$LOG warning "connection tracking not enabled" |
|
|
|
|
|
|
|
|
config_list_foreach "$interface" flush_conntrack handle_flush "$action" |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|