diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-05-10 17:29:59 +0200 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-05-20 08:17:06 +0200 |
| commit | 3f962298bfcf2fb0c6a30b4f1d9e1423321409cb (patch) | |
| tree | 5a6f00d996edfc3dc127c3abcc139f582d780cef /src/tools/oping/oping_client.c | |
| parent | 9b1e5b3ac032449deb47357784b108551702e748 (diff) | |
| download | ouroboros-3f962298bfcf2fb0c6a30b4f1d9e1423321409cb.tar.gz ouroboros-3f962298bfcf2fb0c6a30b4f1d9e1423321409cb.zip | |
tools: Add timeout option to oping
Add a -W/--timeout option to override the per-packet recv timeout.
The default is 2000 ms. Raises the receive buffer to 16 KiB so larger
SDUs aren't truncated (useful for fragmentation tests later on).
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/tools/oping/oping_client.c')
| -rw-r--r-- | src/tools/oping/oping_client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index 62b94e67..4b01315d 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -90,7 +90,7 @@ static void print_rtt(int len, int seq, void * reader(void * o) { - struct timespec timeout = {client.interval / 1000 + 2, 0}; + struct timespec timeout; struct timespec now = {0, 0}; struct timespec sent; @@ -101,6 +101,9 @@ void * reader(void * o) double ms = 0; uint32_t exp_id = 0; + timeout.tv_sec = client.timeout / 1000; + timeout.tv_nsec = (client.timeout % 1000) * MILLION; + fccntl(fd, FLOWSRCVTIMEO, &timeout); while (!stop && client.rcvd != client.count) { |
