From 2d345f1235967d7afd79f262959674093b3b5e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tilmann=20Z=C3=A4schke?= Date: Mon, 4 May 2026 17:07:58 +0200 Subject: [PATCH 1/2] showpaths timeout --- CHANGELOG.md | 2 ++ src/main/java/org/scion/cli/Showpaths.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 755263c..71cd041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `address` was giving too many address. [#20](https://github.com/netsec-ethz/jpan-cli/pull/20) +- Fixed missing `--timeout` for `showpaths`. + [#21](https://github.com/netsec-ethz/jpan-cli/pull/21) ### Changed diff --git a/src/main/java/org/scion/cli/Showpaths.java b/src/main/java/org/scion/cli/Showpaths.java index 90afb99..14fb579 100644 --- a/src/main/java/org/scion/cli/Showpaths.java +++ b/src/main/java/org/scion/cli/Showpaths.java @@ -42,7 +42,7 @@ public class Showpaths { private Long isdAs; private boolean extended = false; private int maxPaths = 10; - private final int timeoutMs = 5000; + private int timeoutMs = 5000; private boolean probePath = true; public static void main(String... args) { @@ -109,6 +109,9 @@ private void parseArgs(String[] argsArray) { case "--sciond": daemon = parseAddress("sciond", args); break; + case "--timeout": + timeoutMs = parseInt("timeout", args); + break; default: throw new ExitCodeException(2, Errors.UNKNOWN_OPTION + args.get(0)); } From ab8dcae321a8cae12bfbee2abf290421dfb5e62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tilmann=20Z=C3=A4schke?= Date: Mon, 4 May 2026 17:15:41 +0200 Subject: [PATCH 2/2] showpaths timeout --- CHANGELOG.md | 2 +- src/main/java/org/scion/cli/Ping.java | 2 +- src/main/java/org/scion/cli/Traceroute.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71cd041..b93ff5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `address` was giving too many address. [#20](https://github.com/netsec-ethz/jpan-cli/pull/20) -- Fixed missing `--timeout` for `showpaths`. +- Fixed missing `--timeout` for `showpaths`. Fixed timeout message. [#21](https://github.com/netsec-ethz/jpan-cli/pull/21) ### Changed diff --git a/src/main/java/org/scion/cli/Ping.java b/src/main/java/org/scion/cli/Ping.java index 57c76d3..26b30fd 100644 --- a/src/main/java/org/scion/cli/Ping.java +++ b/src/main/java/org/scion/cli/Ping.java @@ -226,7 +226,7 @@ private void send(Path path) throws IOException { } if (nTimeouts > 0) { String msg = ""; - if (localPort == null || localPort != 30041) { + if (nTimeouts == count && (localPort == null || localPort != 30041)) { msg = ". Try using \"--port 30041\""; } throw new ExitCodeException(1, "Number of timeouts: " + nTimeouts + msg); diff --git a/src/main/java/org/scion/cli/Traceroute.java b/src/main/java/org/scion/cli/Traceroute.java index a4650fd..f4ca85f 100644 --- a/src/main/java/org/scion/cli/Traceroute.java +++ b/src/main/java/org/scion/cli/Traceroute.java @@ -196,7 +196,7 @@ private void send(Path path) throws IOException { } if (nTimeouts > 0) { String msg = ""; - if (localPort == null || localPort != 30041) { + if (nTimeouts == results.size() && (localPort == null || localPort != 30041)) { msg = ". Try using \"--port 30041\""; } throw new ExitCodeException(1, "Number of timeouts: " + nTimeouts + msg);