diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-04-27 20:43:05 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-04-27 20:43:05 +0200 |
commit | 1ae142d7d11862b11a6e0cea06562875cc778ae7 (patch) | |
tree | b7fc97375bc25e402f160dee9f8edca2e954faf2 | |
parent | 2f80fe3767207e2dbb8c5286603f49808b66a60d (diff) |
luci-mod-network: diagnostics: peg max traceroute hops to rpc timeout
In the worst case, traceroute might take up to 30s to complete when tracing
a completely unreachable path, due to the default limit of 30 hops multiplied
by the per-hop deadline of 1 second (-w 1).
Limit the maximum amount of hops to the configured rpc execution timeout,
20 second by default, in order to avoid running into timed out rpc requests.
Fixes: #5782
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js index 50ab6ef77c..da7cd95bdc 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js @@ -29,7 +29,7 @@ return view.extend({ handlePing: function(ev, cmd) { var exec = cmd || 'ping', addr = ev.currentTarget.parentNode.previousSibling.value, - args = (exec == 'ping') ? [ '-4', '-c', '5', '-W', '1', addr ] : [ '-c', '5', addr ]; + args = (exec == 'ping') ? [ '-4', '-c', '5', '-W', '1', addr ] : [ '-6', '-c', '5', addr ]; return this.handleCommand(exec, args); }, @@ -37,7 +37,7 @@ return view.extend({ handleTraceroute: function(ev, cmd) { var exec = cmd || 'traceroute', addr = ev.currentTarget.parentNode.previousSibling.value, - args = (exec == 'traceroute') ? [ '-4', '-q', '1', '-w', '1', '-n', addr ] : [ '-q', '1', '-w', '2', '-n', addr ]; + args = (exec == 'traceroute') ? [ '-4', '-q', '1', '-w', '1', '-n', '-m', String(L.env.rpctimeout || 20), addr ] : [ '-q', '1', '-w', '2', '-n', addr ]; return this.handleCommand(exec, args); }, |