- Make network_forward_remove() more resilient.

This commit is contained in:
AlkorZ3 committed 2026-11-02 15:34:17 +01:00
1 parent 8756db075e
commit e8b82ba2d9
3 files changed
+12 -5

No files matched your search

+3 -4
View File
@@ -47,7 +47,7 @@ fi
#-----------------------------------------------------------------------------------------------------------------------------------
declare LIB_NAME="Network"
declare LIB_VERSION="1.2.4"
declare LIB_VERSION="1.2.7"
declare -g N ETWORK_OPENVPN_STATUS
@@ -1260,7 +1260,6 @@ function bridge_down
log_trace "Network" "Remove bridge [${bd_bridge_device}]..."
# ${DEBUG} ip link show ${bd_bridge_device} &>/dev/null && ${DEBUG} ip link del ${bd_bridge_device}
${DEBUG} ip link del ${bd_bridge_device} || true
}
@@ -1355,8 +1354,8 @@ network_forward_remove()
nfr_port_start=$2
nfr_port_end=$3
${DEBUG} iptables -t nat -D PREROUTING-VPN -p tcp -m tcp --dport ${nfr_port_start}:${nfr_port_end} -j DNAT --to ${nfr_ip}
${DEBUG} iptables -t nat -D PREROUTING-VPN -p udp -m udp --dport ${nfr_port_start}:${nfr_port_end} -j DNAT --to ${nfr_ip}
${DEBUG} iptables -t nat -D PREROUTING-VPN -p tcp -m tcp --dport ${nfr_port_start}:${nfr_port_end} -j DNAT --to ${nfr_ip} || true
${DEBUG} iptables -t nat -D PREROUTING-VPN -p udp -m udp --dport ${nfr_port_start}:${nfr_port_end} -j DNAT --to ${nfr_ip} || true
}