mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
mwan3: add more error logging to routing functions
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
committed by
Florian Eckert
parent
24e1504b0b
commit
c6fce89bf7
@@ -22,7 +22,7 @@ func_trap()
|
|||||||
|
|
||||||
mwan3_add_all_routes()
|
mwan3_add_all_routes()
|
||||||
{
|
{
|
||||||
local tid IP IPT route_line family active_tbls tid initial_state
|
local tid IP IPT route_line family active_tbls tid initial_state error
|
||||||
local ipv=$1
|
local ipv=$1
|
||||||
|
|
||||||
add_active_tbls()
|
add_active_tbls()
|
||||||
@@ -40,8 +40,8 @@ mwan3_add_all_routes()
|
|||||||
{
|
{
|
||||||
let tid++
|
let tid++
|
||||||
[ -n "${active_tbls##* $tid *}" ] && return
|
[ -n "${active_tbls##* $tid *}" ] && return
|
||||||
$IP route add table $tid $route_line ||
|
error=$($IP route add table $tid $route_line 2>&1) ||
|
||||||
LOG warn "failed to add $route_line to table $tid"
|
LOG warn "failed to add $route_line to table $tid - error: $error"
|
||||||
}
|
}
|
||||||
|
|
||||||
mwan3_update_dev_to_table
|
mwan3_update_dev_to_table
|
||||||
@@ -100,6 +100,7 @@ mwan3_rtmon_route_handle()
|
|||||||
route_line=$(echo "$route_line" | sed -ne "$MWAN3_ROUTE_LINE_EXP")
|
route_line=$(echo "$route_line" | sed -ne "$MWAN3_ROUTE_LINE_EXP")
|
||||||
|
|
||||||
handle_route() {
|
handle_route() {
|
||||||
|
local error
|
||||||
local iface=$1
|
local iface=$1
|
||||||
tbl=$($IP route list table $tid 2>/dev/null)$'\n'
|
tbl=$($IP route list table $tid 2>/dev/null)$'\n'
|
||||||
|
|
||||||
@@ -117,8 +118,8 @@ mwan3_rtmon_route_handle()
|
|||||||
|
|
||||||
network_get_device device "$iface"
|
network_get_device device "$iface"
|
||||||
LOG debug "adjusting route $device: '$IP route $action table $tid $route_line'"
|
LOG debug "adjusting route $device: '$IP route $action table $tid $route_line'"
|
||||||
$IP route "$action" table $tid $route_line ||
|
error=$($IP route "$action" table $tid $route_line 2>&1)||
|
||||||
LOG warn "failed: '$IP route $action table $tid $route_line'"
|
LOG warn "failed: '$IP route $action table $tid $route_line' - error: $error"
|
||||||
}
|
}
|
||||||
handle_route_cb(){
|
handle_route_cb(){
|
||||||
local iface=$1
|
local iface=$1
|
||||||
|
|||||||
Reference in New Issue
Block a user