-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miniupnpc: 2.2.7 -> 2.2.8, again #326402
Merged
+773
−281
Merged
miniupnpc: 2.2.7 -> 2.2.8, again #326402
Changes from 11 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
4b9186a
Reapply "miniupnpc: 2.2.7 -> 2.2.8 , support static build"
emilazy b0ee42d
transmission_4: fix build error with our miniupnp
doronbehar 579e16b
transmission_3: add patch for miniupnpc 2.2.8
emilazy 314f169
bitcoin: add upstream patch for miniupnpc 2.2.8
emilazy 37087ef
bitcoin-abc: add upstream patch for miniupnpc 2.2.8
emilazy 2257420
i2pd: add upstream patch for miniupnpc 2.2.8
emilazy 2bf72c4
sunshine: add upstream patch for miniupnpc 2.2.8
emilazy 72446c1
flycast: add upstream patch for miniupnpc 2.2.8
emilazy 58b9ac8
bitcoind-knots: add upstream patch for miniupnpc 2.2.8
emilazy 416aae7
retroshare: 0.6.6 -> 0.6.7.2
emilazy edc7668
retroshare: add upstream patch for miniupnpc 2.2.8
emilazy 0abdd64
namecoind: add upstream patch for miniupnpc 2.2.8
emilazy c9ba793
groestlcoind: add upstream patch for miniupnpc 2.2.8
emilazy 2e46cc8
eiskaltdcpp: add upstream patch for miniupnpc 2.2.8
emilazy 77fbc57
litecoin: add patch for miniupnpc 2.2.8
emilazy 0539f86
monero-cli: build with Ninja
emilazy 497259f
monero-cli: add patch for miniupnpc 2.2.8
emilazy f96b9b9
haven-cli: build with Ninja
emilazy 5a149da
haven-cli: use patches from monero-cli
emilazy de9db75
alephone: add patch for miniupnpc 2.2.8
emilazy b9f0aa8
zeroad: add patch for miniupnpc 2.2.8
emilazy 7e44344
yaup: add patch for miniupnpc 2.2.8
emilazy c5ff204
dante: add patch for miniupnpc 2.2.8
emilazy ca39d29
chiaki4deck: add patch for miniupnpc 2.2.8
emilazy 9511ce9
elements: add patch for miniupnpc 2.2.8
emilazy fcf6c25
particl-core: add patch for miniupnpc 2.2.8
emilazy defe4ae
gridcoin-research: 5.4.8.0 -> 5.4.8.0-hotfix-1
emilazy 38d971a
pshs: move to `pkgs/by-name`
emilazy f5b70e5
pshs: format with `nixfmt-rfc-style`
emilazy 5bc8c69
pshs: modernize
emilazy 4d9b599
pshs: support all Unix platforms
emilazy f67cebe
pshs: 0.3.4 -> 0.4.3
emilazy 953b05c
qodem: move to `pkgs/by-name`
emilazy 956487c
qodem: format with `nixfmt-rfc-style`
emilazy b78f96a
qodem: modernize
emilazy 8dd4be4
qodem: fix build on Darwin
emilazy 187349b
qodem: 1.0.1 -> 1.0.1-unstable-2022-02-12
emilazy 6875020
qodem: add patches
emilazy 4a46bb9
masari: drop
emilazy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
pkgs/applications/networking/p2p/retroshare/cpp-filesystem.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
pkgs/by-name/tr/transmission_3/transmission-3.00-miniupnpc-2.2.8.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c | ||
index c9e248a379...c7b2580bcb 100644 | ||
--- a/libtransmission/upnp.c | ||
+++ b/libtransmission/upnp.c | ||
@@ -194,8 +194,13 @@ | ||
|
||
errno = 0; | ||
|
||
+#if (MINIUPNPC_API_VERSION >= 18) | ||
if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr, | ||
+ sizeof(handle->lanaddr), NULL, 0) == UPNP_IGD_VALID_CONNECTED) | ||
+#else | ||
+ if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, handle->lanaddr, | ||
sizeof(handle->lanaddr)) == UPNP_IGD_VALID_CONNECTED) | ||
+#endif | ||
{ | ||
tr_logAddNamedInfo(getKey(), _("Found Internet Gateway Device \"%s\""), handle->urls.controlURL); | ||
tr_logAddNamedInfo(getKey(), _("Local Address is \"%s\""), handle->lanaddr); |
120 changes: 120 additions & 0 deletions
120
pkgs/servers/sunshine/0001-fix-upnp-support-newer-miniupnpc-library-2782.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
From f4f1800f5e67ab59312ccf710695acf06fb4ae26 Mon Sep 17 00:00:00 2001 | ||
From: ReenigneArcher <[email protected]> | ||
Date: Mon, 1 Jul 2024 10:07:06 -0400 | ||
Subject: [PATCH] fix(upnp): support newer miniupnpc library (#2782) | ||
|
||
Co-authored-by: Vithorio Polten <[email protected]> | ||
--- | ||
src/upnp.cpp | 30 +++++++++++++++--------------- | ||
src/upnp.h | 31 ++++++++++++++++++++++++++++++- | ||
2 files changed, 45 insertions(+), 16 deletions(-) | ||
|
||
diff --git a/src/upnp.cpp b/src/upnp.cpp | ||
index f65bcb87..fcbaaeb5 100644 | ||
--- a/src/upnp.cpp | ||
+++ b/src/upnp.cpp | ||
@@ -19,19 +19,6 @@ | ||
using namespace std::literals; | ||
|
||
namespace upnp { | ||
- constexpr auto INET6_ADDRESS_STRLEN = 46; | ||
- | ||
- constexpr auto PORT_MAPPING_LIFETIME = 3600s; | ||
- constexpr auto REFRESH_INTERVAL = 120s; | ||
- | ||
- constexpr auto IPv4 = 0; | ||
- constexpr auto IPv6 = 1; | ||
- | ||
- using device_t = util::safe_ptr<UPNPDev, freeUPNPDevlist>; | ||
- | ||
- KITTY_USING_MOVE_T(urls_t, UPNPUrls, , { | ||
- FreeUPNPUrls(&el); | ||
- }); | ||
|
||
struct mapping_t { | ||
struct { | ||
@@ -59,6 +46,19 @@ namespace upnp { | ||
return "Unknown status"sv; | ||
} | ||
|
||
+ /** | ||
+ * This function is a wrapper around UPNP_GetValidIGD() that returns the status code. There is a pre-processor | ||
+ * check to determine which version of the function to call based on the version of the MiniUPnPc library. | ||
+ */ | ||
+ int | ||
+ UPNP_GetValidIGDStatus(device_t &device, urls_t *urls, IGDdatas *data, std::array<char, INET6_ADDRESS_STRLEN> &lan_addr) { | ||
+#if (MINIUPNPC_API_VERSION >= 18) | ||
+ return UPNP_GetValidIGD(device.get(), &urls->el, data, lan_addr.data(), lan_addr.size(), nullptr, 0); | ||
+#else | ||
+ return UPNP_GetValidIGD(device.get(), &urls->el, data, lan_addr.data(), lan_addr.size()); | ||
+#endif | ||
+ } | ||
+ | ||
class deinit_t: public platf::deinit_t { | ||
public: | ||
deinit_t() { | ||
@@ -109,7 +109,7 @@ namespace upnp { | ||
IGDdatas data; | ||
urls_t urls; | ||
std::array<char, INET6_ADDRESS_STRLEN> lan_addr; | ||
- auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size()); | ||
+ auto status = upnp::UPNP_GetValidIGDStatus(device, &urls, &data, lan_addr); | ||
if (status != 1 && status != 2) { | ||
BOOST_LOG(debug) << "No valid IPv6 IGD: "sv << status_string(status); | ||
return false; | ||
@@ -331,7 +331,7 @@ namespace upnp { | ||
std::array<char, INET6_ADDRESS_STRLEN> lan_addr; | ||
|
||
urls_t urls; | ||
- auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size()); | ||
+ auto status = upnp::UPNP_GetValidIGDStatus(device, &urls, &data, lan_addr); | ||
if (status != 1 && status != 2) { | ||
BOOST_LOG(error) << status_string(status); | ||
mapped = false; | ||
diff --git a/src/upnp.h b/src/upnp.h | ||
index 73fc4f79..4b2e3296 100644 | ||
--- a/src/upnp.h | ||
+++ b/src/upnp.h | ||
@@ -4,9 +4,38 @@ | ||
*/ | ||
#pragma once | ||
|
||
+#include <miniupnpc/miniupnpc.h> | ||
+ | ||
#include "platform/common.h" | ||
|
||
namespace upnp { | ||
+ constexpr auto INET6_ADDRESS_STRLEN = 46; | ||
+ constexpr auto IPv4 = 0; | ||
+ constexpr auto IPv6 = 1; | ||
+ constexpr auto PORT_MAPPING_LIFETIME = 3600s; | ||
+ constexpr auto REFRESH_INTERVAL = 120s; | ||
+ | ||
+ using device_t = util::safe_ptr<UPNPDev, freeUPNPDevlist>; | ||
+ | ||
+ KITTY_USING_MOVE_T(urls_t, UPNPUrls, , { | ||
+ FreeUPNPUrls(&el); | ||
+ }); | ||
+ | ||
+ /** | ||
+ * @brief Get the valid IGD status. | ||
+ * @param device The device. | ||
+ * @param urls The URLs. | ||
+ * @param data The IGD data. | ||
+ * @param lan_addr The LAN address. | ||
+ * @return The UPnP Status. | ||
+ * @retval 0 No IGD found. | ||
+ * @retval 1 A valid connected IGD has been found. | ||
+ * @retval 2 A valid IGD has been found but it reported as not connected. | ||
+ * @retval 3 An UPnP device has been found but was not recognized as an IGD. | ||
+ */ | ||
+ int | ||
+ UPNP_GetValidIGDStatus(device_t &device, urls_t *urls, IGDdatas *data, std::array<char, INET6_ADDRESS_STRLEN> &lan_addr); | ||
+ | ||
[[nodiscard]] std::unique_ptr<platf::deinit_t> | ||
start(); | ||
-} | ||
+} // namespace upnp | ||
-- | ||
2.45.2 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is
fetchpatch2
used here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchpatch
is “deprecated”;fetchpatch2
is meant to be better but is backwards‐incompatible, so you have to opt in.Ironically we probably need a
fetchpatch3
: #266556