From fbeaa8ce10a85a97b61e8b14c17b2ab6346a0625 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sun, 26 Mar 2023 14:20:07 +1100 Subject: [PATCH] porting fixes --- rrqnet.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rrqnet.c b/rrqnet.c index 82b524d..69c363c 100644 --- a/rrqnet.c +++ b/rrqnet.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -954,7 +955,7 @@ static void sendpacket4(unsigned char *buf, int n,struct Remote *r) { .msg_controllen = CMSG_SPACE( sizeof( struct in_pktinfo ) ), .msg_flags = 0 // unused }; - VERBOSE2OUT( "sendmsg ipv4 %lu from %s to %s\n", + VERBOSE2OUT( "sendmsg ipv4 %zu from %s to %s\n", msg.msg_controllen, inet_stoa( &r->laddr ), inet_stoa( &r->uaddr ) ); @@ -1099,7 +1100,7 @@ static struct Interface *input_check(PacketItem *pi) { ssize_t len = pi->len; struct SockAddr *src = &pi->src; - VERBOSE2OUT( "RECV %ld bytes from %s\n", len, inet_stoa( src ) ); + VERBOSE2OUT( "RECV %zd bytes from %s\n", len, inet_stoa( src ) ); struct Remote *r = 0; struct timeval now = { 0 }; if ( gettimeofday( &now, 0 ) ) { @@ -1139,7 +1140,7 @@ static struct Interface *input_check(PacketItem *pi) { // Ignore short data, but maintain channel r->rec_when = now; // Update activity stamp touched remote if ( len > 0 ) { - VERBOSEOUT( "Ignoring %ld bytes from %s\n", + VERBOSEOUT( "Ignoring %zd bytes from %s\n", len, inet_stoa( src ) ); } return 0; @@ -1205,12 +1206,12 @@ static struct Interface *input_check(PacketItem *pi) { // primary channel, or the time since the last packet for that // interface is less than RECENT_MICROS, with different limits // for broadcast and unicast. - int64_t dmac = DIFF_MICROS( &now, &x->rec_when); + uint64_t dmac = DIFF_MICROS( &now, &x->rec_when); if ( x->remote->spec == 0 || RECENT_MICROS( *buf & 1, dmac ) ) { if ( verbose >= 2 ) { fprintf( stderr, - "Dropped. MAC %s (%ld) from %s, should be %s\n", + "Dropped. MAC %s (%"PRIu64") from %s, should be %s\n", inet_mtoa( buf+6 ), dmac, inet_stoa( src ), inet_stoa( &x->remote->uaddr ) ); } @@ -1295,7 +1296,7 @@ static void route_packet(PacketItem *pi) { if ( r->spec && ! is_uplink( r->spec ) && DIFF_MICROS( &now, &r->rec_when ) > VERYOLD_MICROS ) { // remove old downlink connection - VERBOSEOUT( "Old remote discarded %s (%ld)\n", + VERBOSEOUT( "Old remote discarded %s (%"PRId64")\n", inet_stoa( &r->uaddr ), TIME_MICROS( &r->rec_when ) ); // Removing a downlink might have threading implications -- 2.39.2