git: 12a18174c4f6 - main - net-p2p/monero-cli: fix returcode with miniupnpc 2.2.8

From: Dirk Meyer <dinoex_at_FreeBSD.org>
Date: Fri, 16 Aug 2024 15:02:35 UTC
The branch main has been updated by dinoex:

URL: https://cgit.FreeBSD.org/ports/commit/?id=12a18174c4f6dbfd63e4902723a12d32a9552e8c

commit 12a18174c4f6dbfd63e4902723a12d32a9552e8c
Author:     Dirk Meyer <dinoex@FreeBSD.org>
AuthorDate: 2024-08-16 15:02:16 +0000
Commit:     Dirk Meyer <dinoex@FreeBSD.org>
CommitDate: 2024-08-16 15:02:16 +0000

    net-p2p/monero-cli: fix returcode with miniupnpc 2.2.8
    
    PR: 280298
---
 net-p2p/monero-cli/Makefile                        |  2 +-
 .../monero-cli/files/patch-src_p2p_net__node.inl   | 27 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/net-p2p/monero-cli/Makefile b/net-p2p/monero-cli/Makefile
index b248ad6be563..8cae7b9935d4 100644
--- a/net-p2p/monero-cli/Makefile
+++ b/net-p2p/monero-cli/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	monero-cli
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.18.3.1
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	net-p2p finance
 
 MAINTAINER=	ports@FreeBSD.org
diff --git a/net-p2p/monero-cli/files/patch-src_p2p_net__node.inl b/net-p2p/monero-cli/files/patch-src_p2p_net__node.inl
index b58bd7d07158..b2414132714d 100644
--- a/net-p2p/monero-cli/files/patch-src_p2p_net__node.inl
+++ b/net-p2p/monero-cli/files/patch-src_p2p_net__node.inl
@@ -25,7 +25,7 @@
      freeUPNPDevlist(deviceList);
      if (result > 0) {
        if (result == 1) {
-@@ -3057,7 +3061,11 @@ namespace nodetool
+@@ -3057,10 +3061,18 @@ namespace nodetool
      UPNPUrls urls;
      IGDdatas igdData;
      char lanAddress[64];
@@ -36,4 +36,29 @@
 +#endif 
      freeUPNPDevlist(deviceList);
      if (result > 0) {
++#if MINIUPNPC_API_VERSION >= 18
++      if ((result == 1) || (result == 2)) {
++#else
        if (result == 1) {
++#endif 
+         std::ostringstream portString;
+         portString << port;
+ 
+@@ -3071,10 +3083,17 @@ namespace nodetool
+         } else {
+           MLOG_GREEN(el::Level::Info, "Deleted IGD port mapping.");
+         }
++#if MINIUPNPC_API_VERSION >= 18
++      } else if (result == 3) {
++        MWARNING("IGD was found but reported as not connected.");
++      } else if (result == 4) {
++        MWARNING("UPnP device was found but not recognized as IGD.");
++#else
+       } else if (result == 2) {
+         MWARNING("IGD was found but reported as not connected.");
+       } else if (result == 3) {
+         MWARNING("UPnP device was found but not recognized as IGD.");
++#endif 
+       } else {
+         MWARNING("UPNP_GetValidIGD returned an unknown result code.");
+       }