Skip to content

Commit

Permalink
fix(upnp): Support miniupnpc API version 18 (release 2.2.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
chewi authored and ReenigneArcher committed Jun 30, 2024
1 parent 90fd371 commit 09b7ac3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/upnp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ namespace upnp {
IGDdatas data;
urls_t urls;
std::array<char, INET6_ADDRESS_STRLEN> lan_addr;
#if (MINIUPNPC_API_VERSION >= 18)
auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size(), nullptr, 0);
#else
auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size());
#endif
if (status != 1 && status != 2) {
BOOST_LOG(debug) << "No valid IPv6 IGD: "sv << status_string(status);
return false;
Expand Down Expand Up @@ -331,7 +335,11 @@ namespace upnp {
std::array<char, INET6_ADDRESS_STRLEN> lan_addr;

urls_t urls;
#if (MINIUPNPC_API_VERSION >= 18)
auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size(), nullptr, 0);
#else
auto status = UPNP_GetValidIGD(device.get(), &urls.el, &data, lan_addr.data(), lan_addr.size());
#endif
if (status != 1 && status != 2) {
BOOST_LOG(error) << status_string(status);
mapped = false;
Expand Down

0 comments on commit 09b7ac3

Please sign in to comment.