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); }