review D16654 replaced begemotSnmpdPortStatus with begemotSnmpdTransInetStatus to support ipv6. With ipv4, addresses are reversed now, i.e. they must be both specified reversed and are shown reversed. If you enable the following standard example line in /etc/snmpd.config # UDP over IPv4: 127.0.0.1:161 # begemotSnmpdTransInetStatus.1.4.127.0.0.1.161.1 = 4 bsnmpd doesn't listen to 127.0.0.1. Unfortunately, you don't even get an error messages. But if you write the address reversed # UDP over IPv4: 127.0.0.1:161 # begemotSnmpdTransInetStatus.1.4.1.0.0.127.161.1 = 4 bsnmp listens to 127.0.0.1 according to "netstat -an4 | grep 161" udp4 0 0 127.0.0.1.161 *.* Even if you query the daemon using snmpwalk, you get BEGEMOT-SNMPD-MIB::begemotSnmpdTransInetStatus.ipv4."1.0.0.127".161.udp = INTEGER: active(1) So it seems that to endianess problem occurs when the daemon binds to the given address. Probably there is some missing or superflous hton or ntoh there.
Created attachment 209245 [details] Proposed patch Hello, can you test this patch?
Hi, I've just compiled the daemon - and it works now! Thanks a lot, Thomas
A commit references this bug: Author: ae Date: Tue Nov 19 16:29:47 UTC 2019 New revision: 354858 URL: https://svnweb.freebsd.org/changeset/base/354858 Log: Fix the byte order of IPv4 address parsed from begemotSnmpdTransInetStatus config option. An address is already in network byte order, there is no need to do htonl(). PR: 242056 MFC after: 1 week Changes: head/contrib/bsnmp/snmpd/trans_inet.c
A commit references this bug: Author: ae Date: Tue Nov 26 02:50:26 UTC 2019 New revision: 355105 URL: https://svnweb.freebsd.org/changeset/base/355105 Log: MFC r354858: Fix the byte order of IPv4 address parsed from begemotSnmpdTransInetStatus config option. An address is already in network byte order, there is no need to do htonl(). PR: 242056 Changes: _U stable/12/ stable/12/contrib/bsnmp/snmpd/trans_inet.c
Fixed in head/ and stable/12. Thanks!