transmission: fix compilation with miniupnpc 2.2.8
authorKarol Kolacinski <kolacinskikarol@live.com>
Sat, 6 Jul 2024 16:17:13 +0000 (18:17 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 7 Jul 2024 20:44:21 +0000 (21:44 +0100)
Backport pending patch, which was submitted to upstream via GitHub
to use modified function to compile it against miniupnpc 2.2.8.

Signed-off-by: Karol Kolacinski <kolacinskikarol@live.com>
net/transmission/patches/010-temp-miniupnpc-2.2.8-compile.patch [new file with mode: 0644]

diff --git a/net/transmission/patches/010-temp-miniupnpc-2.2.8-compile.patch b/net/transmission/patches/010-temp-miniupnpc-2.2.8-compile.patch
new file mode 100644 (file)
index 0000000..984ad0e
--- /dev/null
@@ -0,0 +1,28 @@
+From febfe49ca3ecab1a7142ecb34012c1f0b2bcdee8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C5=93ur?= <coeur@gmx.fr>
+Date: Sat, 15 Jun 2024 07:24:06 +0800
+Subject: [PATCH] bump miniupnpc to 2.2.8 (#6907)
+
+* bump miniupnpc to 2.2.8
+---
+ libtransmission/port-forwarding-upnp.cc | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/libtransmission/port-forwarding-upnp.cc
++++ b/libtransmission/port-forwarding-upnp.cc
+@@ -275,8 +275,13 @@ tr_port_forwarding_state tr_upnpPulse(tr
+         FreeUPNPUrls(&handle->urls);
+         auto lanaddr = std::array<char, TR_ADDRSTRLEN>{};
+-        if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1) ==
+-            UPNP_IGD_VALID_CONNECTED)
++        if (
++#if (MINIUPNPC_API_VERSION >= 18)
++            UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1, nullptr, 0)
++#else
++            UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1)
++#endif
++            == UPNP_IGD_VALID_CONNECTED)
+         {
+             tr_logAddInfo(fmt::format(_("Found Internet Gateway Device '{url}'"), fmt::arg("url", handle->urls.controlURL)));
+             tr_logAddInfo(fmt::format(_("Local Address is '{address}'"), fmt::arg("address", lanaddr.data())));