Re: [PATCH 1/1] tidbits: net-ping: add ping tidbit using raw socket
Philippe Gerum <[email protected]> Sun, 05 Jul 2026 16:57:49 +0200
| Newsgroups | dev.linux.lists.xenomai |
|---|---|
| Message-ID | <[email protected]> |
Hannes Diethelm <[email protected]> writes: > This tidbit allows to ping any host and measure the response time. > > Signed-off-by: Hannes Diethelm <[email protected]> > --- > tidbits/meson.build | 6 + > tidbits/oob-net-ping.c | 480 +++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 486 insertions(+) > create mode 100644 tidbits/oob-net-ping.c > Thanks. We need this to build on 32bit systems: --- a/tidbits/oob-net-ping.c +++ b/tidbits/oob-net-ping.c @@ -215,7 +215,7 @@ static size_t build_icmp_request(uint8_t *o_frame, size_t icmplen, icmphdr->checksum = cksum; if (verbosity > 1) { - evl_printf("ip_len=%zd, icmp_len=%zd, ip_len=%d, datalen=%ld\n", + evl_printf("ip_len=%zd, icmp_len=%zd, ip_len=%d, datalen=%zu\n", sizeof(*iphdr), sizeof(struct icmphdr), ntohs(iphdr->ip_len), datalen); print_ip_header(iphdr); What about turning this code into the (currently missing) 'evl-ping' utility? I believe it is of general interest to any user. -- Philippe.