From d30abcfc49e7332fc651f5eab70831d768026dec Mon Sep 17 00:00:00 2001 From: starnakin Date: Tue, 16 Dec 2025 07:17:26 -0600 Subject: [PATCH] fix: --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 2aec228..8dded6a 100644 --- a/src/main.c +++ b/src/main.c @@ -213,9 +213,10 @@ int main(int ac, char **av) } while (ret >= 0 && check_reply(&settings.dest.ip, &sender, packet, buffer + sizeof(struct iphdr), packet_size, ret)); - if (ret >= (ssize_t) (sizeof(struct icmphdr) + sizeof(struct iphdr)) && ((struct icmphdr *) buffer + sizeof(struct iphdr))->type == 0) + if (ret >= (ssize_t) (sizeof(struct icmphdr) + sizeof(struct iphdr))) { - stats.packets_received++; + if (((struct icmphdr *) (buffer + sizeof(struct iphdr)))->type == 0) + stats.packets_received++; print_recv(&settings, buffer, &start, &stop, &sender); }