Page MenuHomeFreeBSD

libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config
ClosedPublic

Authored by glebius on Jun 26 2025, 7:57 PM.
Tags
None
Referenced Files
F138247658: D51071.id157680.diff
Sun, Nov 30, 7:21 AM
Unknown Object (File)
Sat, Nov 29, 7:18 PM
Unknown Object (File)
Thu, Nov 27, 9:25 PM
Unknown Object (File)
Thu, Nov 27, 12:03 PM
Unknown Object (File)
Tue, Nov 25, 9:16 PM
Unknown Object (File)
Tue, Nov 25, 2:43 PM
Unknown Object (File)
Mon, Nov 24, 6:58 AM
Unknown Object (File)
Sat, Nov 22, 11:14 PM
Subscribers

Details

Summary

The default /etc/snmpd.config we install for decades has:

begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4

However, libbsnmp internally used DEFAULT_LOCAL set to
"/var/run/snmp.sock" (note missing "d") to fill server pathname in case if
API user didn't provide one. This results with default server config
never working with an application that uses default initializer. The
libbsnmptools has a workaround for that, it defines internally
SNMP_DEFAULT_LOCAL that matches /etc/snmpd.config.

Bring this all to an order:

  • Make a public define SNMP_DEFAULT_LOCAL in libbsnmp.
  • Point it to what /etc/snmpd.config has in.
  • Remove workaround from libbsnmptools.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65109
Build 61992: arc lint + arc unit