HomeFreeBSD

libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config

Description

libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config

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.

Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51071

Details

Provenance
glebiusAuthored on Jul 17 2025, 3:59 PM
Reviewer
harti
Differential Revision
D51071: libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config
Parents
rGd4f042f094ec: libbsnmp: fix local client socket creation
Branches
Unknown
Tags
Unknown