From fa1a14af2e23f13a756b551a223fb65a1b753818 Mon Sep 17 00:00:00 2001 From: Thomas Habets Date: Mon, 19 Dec 2022 20:08:53 +0000 Subject: Fix clang-tidy complaints. No actual changes. --- src/arping.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/arping.c') diff --git a/src/arping.c b/src/arping.c index 4064e04..0476f75 100644 --- a/src/arping.c +++ b/src/arping.c @@ -35,6 +35,7 @@ #include "config.h" #endif +#include #include #include #include @@ -1297,8 +1298,6 @@ pingmac_send(uint16_t id, uint16_t seq) payload_suffix, payload_suffix_size); } - int c; - if (-1 == (icmp = libnet_build_icmpv4_echo(ICMP_ECHO, /* type */ 0, /* code */ 0, /* checksum */ @@ -1366,7 +1365,7 @@ pingmac_send(uint16_t id, uint16_t seq) (long)lastpacketsent.tv_sec, (long)lastpacketsent.tv_nsec); } - if (-1 == (c = libnet_write(libnet))) { + if (-1 == libnet_write(libnet)) { fprintf(stderr, "arping: libnet_write(): %s\n", libnet_geterror(libnet)); sigint(0); @@ -1464,6 +1463,7 @@ pingip_recv(const char *unused, struct pcap_pkthdr *h, const char * const packet struct libnet_arp_hdr *harp; struct timespec arrival; UNUSED(unused); + assert(packet); if (verbose > 2) { printf("arping: received response for IP ping\n"); @@ -1671,6 +1671,7 @@ pingmac_recv(const char* unused, struct pcap_pkthdr *h, uint8_t *packet) struct libnet_icmpv4_hdr *hicmp; struct timespec arrival; UNUSED(unused); + assert(packet); if(verbose>2) { printf("arping: received response for mac ping\n"); -- cgit v1.2.1