X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_misc.c;h=cef7e3d08fa218c7d62806e6cde4db11eda8e593;hb=28b7a53b6;hp=088a5242b97bf4a54c22ff68fe545cf6825611f2;hpb=0912276c6467aa3ee6f570b31245367319da572a;p=tinc diff --git a/src/protocol_misc.c b/src/protocol_misc.c index 088a5242..cef7e3d0 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -1,7 +1,7 @@ /* protocol_misc.c -- handle the meta-protocol, miscellaneous functions Copyright (C) 1999-2005 Ivo Timmermans, - 2000-2013 Guus Sliepen + 2000-2022 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -75,8 +75,8 @@ bool pong_h(connection_t *c, const char *request) { } static bool random_early_drop(connection_t *c) { - if(c->outbuf.len > maxoutbufsize / 2) { - if((c->outbuf.len - maxoutbufsize / 2) > prng((maxoutbufsize) / 2)) { + if(c->outbuf.len > (size_t)maxoutbufsize / 2) { + if((c->outbuf.len - (size_t)maxoutbufsize / 2) > prng((size_t)maxoutbufsize / 2)) { return true; } } @@ -125,7 +125,7 @@ bool send_sptps_tcppacket(connection_t *c, const void *packet, size_t len) { return true; } - if(!send_request(c, "%d %zu", SPTPS_PACKET, len)) { + if(!send_request(c, "%d %lu", SPTPS_PACKET, (unsigned long)len)) { return false; }