0001-Snmpx-fix-const-nonconst-type-mismatch.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 7e541e6dba8d4976bbb490838a09b569f38b047d Mon Sep 17 00:00:00 2001
  2. From: Luca Ceresoli <luca.ceresoli@bootlin.com>
  3. Date: Mon, 26 Jun 2023 17:45:00 +0200
  4. Subject: [PATCH] Snmpx: fix const/nonconst type mismatch
  5. Fixes build failure:
  6. snmp_pp_ext.cpp:1176:28: error: binding reference of type 'Snmp_pp::Pdu&' to 'const Snmp_pp::Pdu' discards qualifiers
  7. 1176 | status = snmpmsg.load( pdu, community, version);
  8. | ^~~
  9. Fixes:
  10. http://autobuild.buildroot.net/results/e8abd6bdc62a028955915706b03d72239786c703/
  11. http://autobuild.buildroot.net/results/24441fb679fbf5f913c9b6431c98aec596ead587/
  12. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
  13. Upstream: sent to katz.agentpp.com@magenta.de and support@agentpp.com
  14. ---
  15. include/agent_pp/snmp_pp_ext.h | 2 +-
  16. src/snmp_pp_ext.cpp | 2 +-
  17. 2 files changed, 2 insertions(+), 2 deletions(-)
  18. diff --git a/include/agent_pp/snmp_pp_ext.h b/include/agent_pp/snmp_pp_ext.h
  19. index 7c5a6783ee70..d8a46060db98 100644
  20. --- a/include/agent_pp/snmp_pp_ext.h
  21. +++ b/include/agent_pp/snmp_pp_ext.h
  22. @@ -807,7 +807,7 @@ public:
  23. * SNMP_CLASS_SUCCESS on success and SNMP_CLASS_ERROR,
  24. * SNMP_CLASS_TL_FAILED on failure.
  25. */
  26. - int send (Pdux const &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &);
  27. + int send (Pdux &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &);
  28. #endif
  29. /**
  30. diff --git a/src/snmp_pp_ext.cpp b/src/snmp_pp_ext.cpp
  31. index 54a29ec8ea28..b61cbf056246 100644
  32. --- a/src/snmp_pp_ext.cpp
  33. +++ b/src/snmp_pp_ext.cpp
  34. @@ -1203,7 +1203,7 @@ int Snmpx::send (Pdux &pdu, SnmpTarget* target)
  35. #else // _SNMPv3 is not defined
  36. -int Snmpx::send (Pdux const &pdu,
  37. +int Snmpx::send (Pdux &pdu,
  38. UdpAddress const &udp_address,
  39. snmp_version version,
  40. OctetStr const &community)
  41. --
  42. 2.34.1