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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 65108 Build 61991: arc lint + arc unit
Event Timeline
Comment Actions
Note: the binding is actually needed when we run in SOCK_DGRAM mode. So this isn't a final revision.