diff options
author | Aaron Goodman <aaronjg@stanford.edu> | 2020-12-13 10:20:45 -0500 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2020-12-16 09:32:44 +0100 |
commit | c6fce89bf7846dca529819643d6549d030213410 (patch) | |
tree | 7f6028b72a8390c89463f456a3bc54241f326cec /net/mwan3/files | |
parent | 24e1504b0b6040b70e9f1de4df6d6af899c0f4a3 (diff) |
mwan3: add more error logging to routing functions
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
Diffstat (limited to 'net/mwan3/files')
-rwxr-xr-x | net/mwan3/files/usr/sbin/mwan3rtmon | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/mwan3/files/usr/sbin/mwan3rtmon b/net/mwan3/files/usr/sbin/mwan3rtmon index 44cd28a91..f916f4a9c 100755 --- a/net/mwan3/files/usr/sbin/mwan3rtmon +++ b/net/mwan3/files/usr/sbin/mwan3rtmon @@ -22,7 +22,7 @@ func_trap() 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 add_active_tbls() @@ -40,8 +40,8 @@ mwan3_add_all_routes() { let tid++ [ -n "${active_tbls##* $tid *}" ] && return - $IP route add table $tid $route_line || - LOG warn "failed to add $route_line to table $tid" + error=$($IP route add table $tid $route_line 2>&1) || + LOG warn "failed to add $route_line to table $tid - error: $error" } mwan3_update_dev_to_table @@ -100,6 +100,7 @@ mwan3_rtmon_route_handle() route_line=$(echo "$route_line" | sed -ne "$MWAN3_ROUTE_LINE_EXP") handle_route() { + local error local iface=$1 tbl=$($IP route list table $tid 2>/dev/null)$'\n' @@ -117,8 +118,8 @@ mwan3_rtmon_route_handle() network_get_device device "$iface" LOG debug "adjusting route $device: '$IP route $action table $tid $route_line'" - $IP route "$action" table $tid $route_line || - LOG warn "failed: '$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' - error: $error" } handle_route_cb(){ local iface=$1 |