From 3f962298bfcf2fb0c6a30b4f1d9e1423321409cb Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 10 May 2026 17:29:59 +0200 Subject: 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 Signed-off-by: Sander Vrijders --- src/tools/oping/oping_client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/tools/oping/oping_client.c') 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) { -- cgit v1.2.3