summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormio <miyopan@e.email>2024-09-06 04:24:54 +0000
committerCeleste <20312-Celeste@users.gitlab.alpinelinux.org>2024-09-06 13:34:17 +0000
commitb9888f128da5628fb99f392aa10bf637c7861026 (patch)
treeb3ef4b3d4c559a01eb727f4f9ef1d71f95418843
parent7e9c4701ab1b8e107b91ef4e4d4952fa4e2efd06 (diff)
downloadaports-b9888f128da5628fb99f392aa10bf637c7861026.zip
community/networkmanager-l2tp: fix build with gcc 14
-rw-r--r--community/networkmanager-l2tp/APKBUILD6
-rw-r--r--community/networkmanager-l2tp/gcc14.patch48
2 files changed, 52 insertions, 2 deletions
diff --git a/community/networkmanager-l2tp/APKBUILD b/community/networkmanager-l2tp/APKBUILD
index 806d8a570fc..c640bad32e6 100644
--- a/community/networkmanager-l2tp/APKBUILD
+++ b/community/networkmanager-l2tp/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=networkmanager-l2tp
pkgver=1.20.16
-pkgrel=0
+pkgrel=1
pkgdesc="L2TP support for NetworkManager"
url="https://github.com/nm-l2tp/NetworkManager-l2tp"
license="GPL-2.0-only"
@@ -23,7 +23,8 @@ makedepends="
python3
"
depends="ppp xl2tpd strongswan"
-source="https://github.com/nm-l2tp/NetworkManager-l2tp/releases/download/$pkgver/NetworkManager-l2tp-$pkgver.tar.xz"
+source="https://github.com/nm-l2tp/NetworkManager-l2tp/releases/download/$pkgver/NetworkManager-l2tp-$pkgver.tar.xz
+ gcc14.patch"
options="!check" #no check
builddir="$srcdir/NetworkManager-l2tp-$pkgver"
subpackages="$pkgname-lang"
@@ -46,4 +47,5 @@ package() {
sha512sums="
d1a8364bae0116d556e1b554846df4efa415c0b84fa667181daae50ea706f7f62fa016290c35985667e9bda7ac237198575083dc816c05f16d6ac997da02aa7d NetworkManager-l2tp-1.20.16.tar.xz
+de3558ef97ef2b5669ddab39ede13485c849e7765b516e62b42a0eee1e222ae670c2d7dd30042e7a0841c0af0d9ace9613ce96bb14b8f20d6c9e531d8a060bef gcc14.patch
"
diff --git a/community/networkmanager-l2tp/gcc14.patch b/community/networkmanager-l2tp/gcc14.patch
new file mode 100644
index 00000000000..b358d60111d
--- /dev/null
+++ b/community/networkmanager-l2tp/gcc14.patch
@@ -0,0 +1,48 @@
+Fix -Wincompatible-pointer-types error with gcc 14.
+
+Error:
+
+```
+src/nm-l2tp-service.c: In function 'get_localaddr':
+src/nm-l2tp-service.c:1921:27: error: passing argument 2 of 'connect' from
+incompatible pointer type [-Wincompatible-pointer-types]
+ 1921 | if (0 != connect (fd, &addr, sizeof(addr))) {
+ | ^~~~~
+ | |
+ | struct sockaddr_in *
+In file included from /usr/include/fortify/sys/socket.h:23,
+ from src/nm-l2tp-service.c:32:
+/usr/include/sys/socket.h:386:19: note: expected 'const struct sockaddr *' but
+argument is of type 'struct sockaddr_in *'
+ 386 | int connect (int, const struct sockaddr *, socklen_t);
+ | ^~~~~~~~~~~~~~~~~~~~~~~
+src/nm-l2tp-service.c:1927:31: error: passing argument 2 of 'getsockname' from
+incompatible pointer type [-Wincompatible-pointer-types]
+ 1927 | if (0 != getsockname( fd, &addr, &alen)) {
+ | ^~~~~
+ | |
+ | struct sockaddr_in *
+/usr/include/sys/socket.h:391:23: note: expected 'struct sockaddr * restrict'
+but argument is of type 'struct sockaddr_in *'
+ 391 | int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
+ | ^
+```
+
+--- NetworkManager-l2tp-1.20.16-origin/src/nm-l2tp-service.c
++++ NetworkManager-l2tp-1.20.16/src/nm-l2tp-service.c
+@@ -1918,13 +1918,13 @@
+ addr.sin_port = htons(1701);
+ addr.sin_addr.s_addr = priv->naddr;
+
+- if (0 != connect (fd, &addr, sizeof(addr))) {
++ if (0 != connect (fd, (struct sockaddr *) &addr, sizeof(addr))) {
+ close (fd);
+ return nm_l2tp_ipsec_error(error, _("unable to connect to L2TP VPN gateway"));
+ }
+
+ memset( &addr, 0, sizeof(addr));
+- if (0 != getsockname( fd, &addr, &alen)) {
++ if (0 != getsockname( fd, (struct sockaddr *) &addr, &alen)) {
+ close (fd);
+ return nm_l2tp_ipsec_error(error, _("failed to get local IP"));
+ }