diff mbox series

[1/1] package/agentpp: bump to version 4.6.1

Message ID 20240430203401.74587-1-jesseevg@gmail.com
State Changes Requested
Headers show
Series [1/1] package/agentpp: bump to version 4.6.1 | expand

Commit Message

Jesse Van Gavere April 30, 2024, 8:34 p.m. UTC
This version integrates the patch to fix building without v3 so remove
that patch, there is however  another failure when linking the library,
debugprintf is used which was removed in snmp++, so patch that.
This patch has been sent to agentpp.

Signed-off-by: Jesse Van Gavere <jesseevg@gmail.com>
---
 .checkpackageignore                           |  1 -
 ...mpx-fix-const-nonconst-type-mismatch.patch | 51 -------------------
 .../0001-fix-Snmpx-linking-without-v3.patch   | 37 ++++++++++++++
 package/agentpp/agentpp.hash                  |  2 +-
 package/agentpp/agentpp.mk                    |  2 +-
 5 files changed, 39 insertions(+), 54 deletions(-)
 delete mode 100644 package/agentpp/0001-Snmpx-fix-const-nonconst-type-mismatch.patch
 create mode 100644 package/agentpp/0001-fix-Snmpx-linking-without-v3.patch

Comments

Luca Ceresoli May 6, 2024, 10:19 a.m. UTC | #1
Hello Jesse,

On Tue, 30 Apr 2024 22:34:01 +0200
Jesse Van Gavere <jesseevg@gmail.com> wrote:

> This version integrates the patch to fix building without v3 so remove
> that patch, there is however  another failure when linking the library,
> debugprintf is used which was removed in snmp++, so patch that.
> This patch has been sent to agentpp.

Sure about this? snmp++ 3.5.1 does not seem to have any changes related
to debugprintf compared to 3.5.0. Also, testing with both of your
patches (this and the snmppp 3.5.1 bump), agentpp builds fine without
the added patch.

Luca
Thomas Petazzoni May 6, 2024, 8:14 p.m. UTC | #2
On Mon, 6 May 2024 12:19:19 +0200
Luca Ceresoli via buildroot <buildroot@buildroot.org> wrote:

> Hello Jesse,
> 
> On Tue, 30 Apr 2024 22:34:01 +0200
> Jesse Van Gavere <jesseevg@gmail.com> wrote:
> 
> > This version integrates the patch to fix building without v3 so remove
> > that patch, there is however  another failure when linking the library,
> > debugprintf is used which was removed in snmp++, so patch that.
> > This patch has been sent to agentpp.  
> 
> Sure about this? snmp++ 3.5.1 does not seem to have any changes related
> to debugprintf compared to 3.5.0. Also, testing with both of your
> patches (this and the snmppp 3.5.1 bump), agentpp builds fine without
> the added patch.

Also, we would prefer the added patch to be formatted using "git
format-patch".

Thomas
Jesse Van Gavere May 6, 2024, 8:22 p.m. UTC | #3
Op ma 6 mei 2024 om 22:14 schreef Thomas Petazzoni
<thomas.petazzoni@bootlin.com>:
>
> On Mon, 6 May 2024 12:19:19 +0200
> Luca Ceresoli via buildroot <buildroot@buildroot.org> wrote:
>
> > Hello Jesse,
> >
> > On Tue, 30 Apr 2024 22:34:01 +0200
> > Jesse Van Gavere <jesseevg@gmail.com> wrote:
> >
> > > This version integrates the patch to fix building without v3 so remove
> > > that patch, there is however  another failure when linking the library,
> > > debugprintf is used which was removed in snmp++, so patch that.
> > > This patch has been sent to agentpp.
> >
> > Sure about this? snmp++ 3.5.1 does not seem to have any changes related
> > to debugprintf compared to 3.5.0. Also, testing with both of your
> > patches (this and the snmppp 3.5.1 bump), agentpp builds fine without
> > the added patch.
>
> Also, we would prefer the added patch to be formatted using "git
> format-patch".
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com

Hello Luca,

You're correct that it does not seem to fail initially, however when
using the Snmpx class from agentpp in my own application is when I got
a linking error on debugprintf it could not resolve, this I could only
fix with the included patch.
What makes me suspect an oversight is that they mentioned that
debugprintf was going to be removed entirely from agentpp in earlier
release notes but some calls remain in the source code, this issue is
also present in both versions hence no changes there.

Thomas,

They make it a bit tricky with their tarball only approach but I'll
see to resubmit it as a git patch.

Best regards,
Jesse
diff mbox series

Patch

diff --git a/.checkpackageignore b/.checkpackageignore
index 1b336ce7a3..5c77b2cb8c 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -1188,7 +1188,6 @@  package/smcroute/S41smcroute NotExecutable lib_sysv.Indent lib_sysv.Variables
 package/smstools3/0001-fix-Makefile.patch lib_patch.Upstream
 package/smstools3/0002-fix-build-with-gcc-10.x.patch lib_patch.Upstream
 package/smstools3/S50smsd Shellcheck lib_sysv.Variables
-package/snmppp/0001-fix-build-without-v3.patch lib_patch.Upstream
 package/snort/0001-configure.in-Avoid-path-poisoning-with-libpcap.patch lib_patch.Upstream
 package/snort/0002-configure.in-Allow-to-override-the-INADDR_NONE-check.patch lib_patch.Upstream
 package/snort/0003-configure.in-convert-AC_RUN_IFELSE-to-AC_CHECK_MEMBE.patch lib_patch.Upstream
diff --git a/package/agentpp/0001-Snmpx-fix-const-nonconst-type-mismatch.patch b/package/agentpp/0001-Snmpx-fix-const-nonconst-type-mismatch.patch
deleted file mode 100644
index 07981eff3e..0000000000
--- a/package/agentpp/0001-Snmpx-fix-const-nonconst-type-mismatch.patch
+++ /dev/null
@@ -1,51 +0,0 @@ 
-From 7e541e6dba8d4976bbb490838a09b569f38b047d Mon Sep 17 00:00:00 2001
-From: Luca Ceresoli <luca.ceresoli@bootlin.com>
-Date: Mon, 26 Jun 2023 17:45:00 +0200
-Subject: [PATCH] Snmpx: fix const/nonconst type mismatch
-
-Fixes build failure:
-
-  snmp_pp_ext.cpp:1176:28: error: binding reference of type 'Snmp_pp::Pdu&' to 'const Snmp_pp::Pdu' discards qualifiers
-   1176 |     status = snmpmsg.load( pdu, community, version);
-        |                            ^~~
-
-Fixes:
-  http://autobuild.buildroot.net/results/e8abd6bdc62a028955915706b03d72239786c703/
-  http://autobuild.buildroot.net/results/24441fb679fbf5f913c9b6431c98aec596ead587/
-
-Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
-Upstream: sent to katz.agentpp.com@magenta.de and support@agentpp.com
----
- include/agent_pp/snmp_pp_ext.h | 2 +-
- src/snmp_pp_ext.cpp            | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/include/agent_pp/snmp_pp_ext.h b/include/agent_pp/snmp_pp_ext.h
-index 7c5a6783ee70..d8a46060db98 100644
---- a/include/agent_pp/snmp_pp_ext.h
-+++ b/include/agent_pp/snmp_pp_ext.h
-@@ -807,7 +807,7 @@ public:
- 	 *   SNMP_CLASS_SUCCESS on success and SNMP_CLASS_ERROR,
- 	 *   SNMP_CLASS_TL_FAILED on failure.
- 	 */
--        int send (Pdux const &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &);
-+        int send (Pdux &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &);
- #endif
- 
- 	/**
-diff --git a/src/snmp_pp_ext.cpp b/src/snmp_pp_ext.cpp
-index 54a29ec8ea28..b61cbf056246 100644
---- a/src/snmp_pp_ext.cpp
-+++ b/src/snmp_pp_ext.cpp
-@@ -1203,7 +1203,7 @@ int Snmpx::send (Pdux &pdu, SnmpTarget* target)
- 
- #else  // _SNMPv3 is not defined
- 
--int Snmpx::send (Pdux  const &pdu,
-+int Snmpx::send (Pdux  &pdu,
- 		 UdpAddress  const &udp_address,
- 		 snmp_version version,
- 		 OctetStr  const &community)
--- 
-2.34.1
-
diff --git a/package/agentpp/0001-fix-Snmpx-linking-without-v3.patch b/package/agentpp/0001-fix-Snmpx-linking-without-v3.patch
new file mode 100644
index 0000000000..9d680995e8
--- /dev/null
+++ b/package/agentpp/0001-fix-Snmpx-linking-without-v3.patch
@@ -0,0 +1,37 @@ 
+Trying to use the Snmpx class will give a link error on debugprintf
+When v3 is not used due to debugprintf not existing anymore in snmp++
+
+Signed-off-by: Jesse Van Gavere <jesse.vangavere@scioteq.com>
+Upstream: sent to katz.agentpp.com@magenta.de and support@agentpp.com
+---
+diff -purN agent++-4.6.1.orig/src/snmp_pp_ext.cpp agent++-4.6.1/src/snmp_pp_ext.cpp
+--- agent++-4.6.1.orig/src/snmp_pp_ext.cpp	2023-08-10 00:05:42.000000000 +0200
++++ agent++-4.6.1/src/snmp_pp_ext.cpp	2024-04-30 14:44:03.371532441 +0200
+@@ -1035,8 +1035,11 @@ int Snmpx::receive(struct timeval *tvptr
+ 	fromaddr = addr;
+ 	fromaddr.set_port(ntohs(((sockaddr_in&)from_addr).sin_port));
+ 
+-	debugprintf(1, "++ AGENT++: data received from %s.",
+-		    fromaddr.get_printable());
++	LOG_BEGIN(loggerModuleName, DEBUG_LOG | 10);
++	LOG("++ AGENT ++: data received from ");
++	LOG(fromaddr.get_printable());
++	LOG(".");
++	LOG_END;
+ 	debughexprintf(5, receive_buffer, receive_buffer_len);
+ 
+ 	snmpmsg.load(receive_buffer, receive_buffer_len);
+@@ -1070,8 +1073,11 @@ int Snmpx::receive(struct timeval *tvptr
+ 	fromaddr = addr;
+ 	fromaddr.set_port(ntohs(((sockaddr_in6&)from_addr).sin6_port));
+ 
+-	debugprintf(1, "++ AGENT++: data received from %s.",
+-		    fromaddr.get_printable());
++	LOG_BEGIN(loggerModuleName, DEBUG_LOG | 10);
++	LOG("++ AGENT ++: data received from ");
++	LOG(fromaddr.get_printable());
++	LOG(".");
++	LOG_END;
+ 	debughexprintf(5, receive_buffer, receive_buffer_len);
+ 
+ 	snmpmsg.load(receive_buffer, receive_buffer_len);
diff --git a/package/agentpp/agentpp.hash b/package/agentpp/agentpp.hash
index 527414eed5..7c94f4b1b0 100644
--- a/package/agentpp/agentpp.hash
+++ b/package/agentpp/agentpp.hash
@@ -1,3 +1,3 @@ 
 # Locally computed:
-sha256  e09dc2d40277d468c18f1539ad18f43e0c3a95b10fad8a02184e9ace8bac0d67  agent++-4.6.0.tar.gz
+sha256  3287218cf6eaa3744b3788afd1e7d72e7a9508d45741243178404f6b47edd86f  agent++-4.6.1.tar.gz
 sha256  1eb85fc97224598dad1852b5d6483bbcf0aa8608790dcc657a5a2a761ae9c8c6  LICENSE-2_0.txt
diff --git a/package/agentpp/agentpp.mk b/package/agentpp/agentpp.mk
index 7616d3eb0c..3756d0ca28 100644
--- a/package/agentpp/agentpp.mk
+++ b/package/agentpp/agentpp.mk
@@ -4,7 +4,7 @@ 
 #
 ################################################################################
 
-AGENTPP_VERSION = 4.6.0
+AGENTPP_VERSION = 4.6.1
 AGENTPP_SOURCE = agent++-$(AGENTPP_VERSION).tar.gz
 AGENTPP_SITE = http://www.agentpp.com/download
 AGENTPP_LICENSE = Apache-2.0