Fix compiler warnings on *BSD.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 17 Apr 2017 11:07:15 +0000 (13:07 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 17 Apr 2017 11:07:15 +0000 (13:07 +0200)
src/net.c
src/openssl/cipher.c
test/pong.c

index 4369ff498dfc3d4b2f0ea29484ad9f3f59d72f56..8cb7ed739f6a2e793f7643b23b8c4c779f8d3c53 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -209,7 +209,7 @@ static void timeout_handler(void *data) {
 
                // timeout during ping
                if(c->status.pinged) {
-                       logger(DEBUG_CONNECTIONS, LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, (long)now.tv_sec - c->last_ping_time);
+                       logger(DEBUG_CONNECTIONS, LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, (long)(now.tv_sec - c->last_ping_time));
                        terminate_connection(c, c->edge);
                        continue;
                }
index e362325a36c6988efffcf6d60852900978884268..a8032ea02a68a7459bb26e3caada3952da12a078 100644 (file)
@@ -137,7 +137,7 @@ bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou
                int len, pad;
                if(EVP_EncryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL)
                                && EVP_EncryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
-                               && EVP_EncryptFinal(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
+                               && EVP_EncryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
                        if(outlen) *outlen = len + pad;
                        return true;
                }
@@ -158,7 +158,7 @@ bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou
                int len, pad;
                if(EVP_DecryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL)
                                && EVP_DecryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
-                               && EVP_DecryptFinal(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
+                               && EVP_DecryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
                        if(outlen) *outlen = len + pad;
                        return true;
                }
index 6e212bf2874deabe3d8aa8c0fd2237ec9ac8fa71..a4f2be7380009cba2cc64feaa32aee04eaa117cb 100644 (file)
@@ -154,7 +154,7 @@ int main(int argc, char *argv[]) {
 #endif
 
                default:
-                       fprintf(stderr, "Multicast for address family %hx unsupported\n", ai->ai_family);
+                       fprintf(stderr, "Multicast for address family %x unsupported\n", ai->ai_family);
                        return 1;
        }