uanytun: fix compilation with GCC14
authorRosen Penev <rosenp@gmail.com>
Tue, 7 Jan 2025 02:18:48 +0000 (18:18 -0800)
committerRosen Penev <rosenp@gmail.com>
Tue, 7 Jan 2025 02:55:23 +0000 (18:55 -0800)
Wrong cast type.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/uanytun/Makefile
net/uanytun/patches/010-gcc14.patch [new file with mode: 0644]

index 1bc995ddcbb0156969cbdd2603e9b6aa7ee0453a..63a0bbc3513f878f36821432acb3e7f722234a36 100644 (file)
@@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uanytun
 PKG_VERSION:=0.3.7
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.anytun.org/download/
diff --git a/net/uanytun/patches/010-gcc14.patch b/net/uanytun/patches/010-gcc14.patch
new file mode 100644 (file)
index 0000000..f00f759
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/src/cipher.c
++++ b/src/cipher.c
+@@ -345,7 +345,7 @@ int32_t cipher_aesctr_crypt(cipher_t* c,
+     log_printf(ERROR, "failed to set cipher CTR: size doesn't fit");
+     return -1;
+   }
+-  ctr_crypt(&params->ctx_, (nettle_crypt_func *)(aes_encrypt), AES_BLOCK_SIZE, params->ctr_.buf_, (ilen < olen) ? ilen : olen, out, in);
++  ctr_crypt(&params->ctx_, (nettle_cipher_func *)(aes_encrypt), AES_BLOCK_SIZE, params->ctr_.buf_, (ilen < olen) ? ilen : olen, out, in);
+ #else  // USE_GCRYPT is the default
+   err = gcry_cipher_setctr(params->handle_, params->ctr_.buf_, C_AESCTR_CTR_LENGTH);
+   if(err) {
+--- a/src/key_derivation.c
++++ b/src/key_derivation.c
+@@ -482,7 +482,7 @@ int key_derivation_aesctr_generate(key_d
+     return -1;
+   }
+   memset(key, 0, len);
+-  ctr_crypt(&params->ctx_, (nettle_crypt_func *)(aes_encrypt), AES_BLOCK_SIZE, params->ctr_.buf_, len, key, key);
++  ctr_crypt(&params->ctx_, (nettle_cipher_func *)(aes_encrypt), AES_BLOCK_SIZE, params->ctr_.buf_, len, key, key);
+ #else  // USE_GCRYPT is the default
+   gcry_error_t err = gcry_cipher_reset(params->handle_);
+   if(err) {