diff options
author | Thomas Habets <thomas@habets.se> | 2022-12-19 20:08:53 +0000 |
---|---|---|
committer | Thomas Habets <thomas@habets.se> | 2022-12-19 20:08:53 +0000 |
commit | fa1a14af2e23f13a756b551a223fb65a1b753818 (patch) | |
tree | 2879eba374af1965c3a54345c3db6eb011d8fa51 /src/arping.c | |
parent | 797b7357f95467998b6b30cc6bc43ec86da354b5 (diff) | |
download | arping-2.x.tar.gz |
Fix clang-tidy complaints. No actual changes.HEADarping-2.x
Diffstat (limited to 'src/arping.c')
-rw-r--r-- | src/arping.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -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"); |