From 3bf29ef19480f4ee61588d4636ba66acbbd34e8b Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Tue, 12 Aug 2025 00:32:50 +0200 Subject: [PATCH] - Fix rule duplicate bug. --- usr/local/lib/network.bash | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr/local/lib/network.bash b/usr/local/lib/network.bash index 6cf7f7b..9dc64d8 100644 --- a/usr/local/lib/network.bash +++ b/usr/local/lib/network.bash @@ -947,7 +947,8 @@ function bridge_up log_trace "Network" "Configure IP rule and routing [${bu_bridge_device}]..." - + + ${DEBUG} ip rule del from ${bu_peer_address} 2>/dev/null ${DEBUG} ip rule add from ${bu_peer_address} table ${bu_table} for bu_tab in ${NETWORK_TABLE_LIST} @@ -1118,8 +1119,12 @@ network_forward_start() for src_id in ${NETWORK_SRC_ID_LIST} do network_src_tab_get ${src_id} - - ${DEBUG} ip rule add from ${src_ip} table ${src_table} + + if [[ "${src_type}" != "0" ]] + then + ${DEBUG} ip rule del from ${src_ip} 2>/dev/null + ${DEBUG} ip rule add from ${src_ip} table ${src_table} + fi if [[ "${src_port_range}" != "0" ]] then