Page MenuHomeFreeBSD

libbsnmp: make binding of client UNIX socket optional and configurable
Needs ReviewPublic

Authored by glebius on Thu, Jun 26, 7:56 PM.
Tags
None
Referenced Files
F122662430: D51070.diff
Mon, Jul 7, 6:30 AM
Unknown Object (File)
Sat, Jul 5, 11:15 AM
Unknown Object (File)
Sat, Jul 5, 7:19 AM
Unknown Object (File)
Tue, Jul 1, 10:49 PM
Unknown Object (File)
Tue, Jul 1, 1:46 AM
Unknown Object (File)
Mon, Jun 30, 3:44 PM
Unknown Object (File)
Sat, Jun 28, 9:51 PM
Unknown Object (File)
Sat, Jun 28, 9:49 PM
Subscribers

Details

Reviewers
harti
syrinx
Summary
Before this change snmp_open(3) would always bind(2) client socket to a
random "/tmp/snmpXXXXXXXXXXXXXX" name.  However, this binding is not
required for SOCK_STREAM transport.  Also, any attempt to specify a
different name would fail, as open_client_local() would blindly rewrite
the name to the default.

Make this binding optional.  If application had initialized
snmp_client.local_path, then try to bind to the specified pathname,
otherwise performa the random name binding only if we are in the
SOCK_DGRAM mode.

While here change snmp_client.local_path size to SUNPATHLEN, so that any
legitimate local socket name can be used.  This requires  library version
bump.

Note that this code has been broken by 81e0e7b9e36d for three years, thus
it is known not to be widely used.

Diff Detail

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