Hi,
The relevant net-snmp change, possibly triggered but didn't cause this
issue.
ezsnmp/interface.h:51:8: error: redefinition of ‘struct session_list’
51 | struct session_list
| ^~~~~~~~~~~~
In file included from /usr/include/net-snmp/types.h:433,
from /usr/include/net-snmp/definitions.h:22,
from /usr/include/net-snmp/net-snmp-includes.h:24,
from ezsnmp/interface.cpp:6:
/usr/include/net-snmp/library/snmp_api.h:745:12: note: previous
definition of ‘struct session_list’
745 | struct session_list {
| ^~~~~~~~~~~~
The problem here that ezsnmp/interface.h and snmp_api.h are both defining
struct session_list.
However,
net-snmp 5.9.4 has that definition.
$ dpkg -l libsnmp-dev
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-===========================================================
ii libsnmp-dev 5.9.4+dfsg-2 amd64 SNMP (Simple Network
Management Protocol) development files
$ grep 'struct session_list' /usr/include/net-snmp/*.h
/usr/include/net-snmp/session_api.h: struct session_list;
/usr/include/net-snmp/session_api.h: _build_initial_pdu_packet(struct
session_list *slp, netsnmp_pdu *pdu,
The ezsnmp header has this definition only defined if
#ifdef HAVE_EVP_MD_CTX_CREATE
is true.
On a trixie system if you comment that out (it's a OpenSSL thing) then you
get the same error using libsnmp-dev 5.9.4
ezsnmp/interface.h:51:8: error: redefinition of ‘struct session_list’
51 | struct session_list
| ^~~~~~~~~~~~
In file included from /usr/include/net-snmp/types.h:425,
from /usr/include/net-snmp/definitions.h:22,
from /usr/include/net-snmp/net-snmp-includes.h:24,
from ezsnmp/interface.cpp:6:
/usr/include/net-snmp/library/snmp_api.h:755:12: note: previous definition
of ‘struct session_list’
755 | struct session_list {
Notice that the line number is different but the error is the same.
So why does libsnmp-dev 5.9.4 work fine and 5.9.5.2 doesn't?
Because of this definition:
5.9.4 has:
$ grep HAVE_EVP_MD_CTX_CREATE /usr/include/net-snmp/*.h
/usr/include/net-snmp/net-snmp-config.h:/* #undef HAVE_EVP_MD_CTX_CREATE */
5.9.5.2 has:
$ grep HAVE_EVP_MD_CTX_CREATE /usr/include/net-snmp/*.h
/usr/include/net-snmp/net-snmp-config.h:#define HAVE_EVP_MD_CTX_CREATE 1
What's really strange about it is:
1) The ezsnmp version is an almost straight copy of the net-snmp one
2) HAVE_EVP_MD_CTX_CREATE is not checked anywhere else.
3) Removing the ezsnmp definition (or changing the ifdef to anything not
defined) fixes the issue
- Craig
--
Craig Small https://dropbear.xyz/ csmall at : dropbear.xyz
Debian GNU/Linux https://www.debian.org/
<http://www.debian.org/> csmall at : debian.org
GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5