From d3daf711b2dbe5291fe2d13016550a0c844a6f55 Mon Sep 17 00:00:00 2001 From: lohhiiccc <96543753+lohhiiccc@users.noreply.github.com> Date: Thu, 5 Feb 2026 22:31:38 +0100 Subject: [PATCH] fix(send/echo): add byte order conversion for id and seq --- src/send/api/echo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/send/api/echo.c b/src/send/api/echo.c index b0b0fe7..8812005 100644 --- a/src/send/api/echo.c +++ b/src/send/api/echo.c @@ -1,5 +1,6 @@ #include "icmp.h" #include "icmp_types.h" +#include #include int @@ -11,8 +12,8 @@ icmp_send_echo(icmp_handle_t *h, struct in_addr dest, uint16_t id, uint32_t raw; } hdr_rest; - hdr_rest.echo.id = id; - hdr_rest.echo.seq = seq; + hdr_rest.echo.id = htons(id); + hdr_rest.echo.seq = htons(seq); return icmp_send_raw(h, ICMP_TYPE_ECHO_REQUEST, 0, hdr_rest.raw, NULL, 0, dest, ttl); }