On Saturday, 4 January 2025 02:36:45 GMT+1 Noah Peterson wrote:
@@ -58,12 +59,16 @@ static int ping(struct state *state, int argc, char **argv) struct batadv_icmp_packet_rr icmp_packet_out; struct batadv_icmp_packet_rr icmp_packet_in; uint8_t last_rr[BATADV_RR_LEN][ETH_ALEN];
struct timespec loop_interval = {0, 0}; struct ether_addr *dst_mac = NULL; struct ether_addr *rr_mac = NULL; int disable_translate_mac = 0;
double fractional_part = 0.0; unsigned int seq_counter = 0; unsigned int packets_out = 0; unsigned int packets_in = 0;
double ping_interval = 0.0;
double integral_part = 0.0; unsigned int packets_loss; struct bat_host *bat_host; struct bat_host *rr_host;
The code doesn't build:
CC ping.o ping.c: In function ‘ping’: ping.c:77:13: error: conflicting types for ‘loop_interval’; have ‘int’ 77 | int loop_interval = 0; | ^~~~~~~~~~~~~ ping.c:62:25: note: previous definition of ‘loop_interval’ with type ‘struct timespec’ 62 | struct timespec loop_interval = {0, 0}; | ^~~~~~~~~~~~~ ping.c:110:57: error: ‘end’ undeclared (first use in this function); did you mean ‘send’? 110 | ping_interval = strtod(optarg, &end); | ^~~ | send ping.c:110:57: note: each undeclared identifier is reported only once for each function it appears in ping.c:77:13: warning: unused variable ‘loop_interval’ [-Wunused-variable] 77 | int loop_interval = 0; | ^~~~~~~~~~~~~
Kind regards, Sven