Bug 840861

Summary: snmpd does not report error when clientaddr <ip>:<port> cannot bind to the specified port
Product: Red Hat Enterprise Linux 5 Reporter: Jan Safranek <jsafrane>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.9CC: dapospis, ksrot
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
This is regression found in internal build, it has not been released. No documentation needed.
Story Points: ---
Clone Of:
: 886468 1877375 (view as bug list) Environment:
Last Closed: 2013-01-08 05:03:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 886468, 1086925, 1877375    

Description Jan Safranek 2012-07-17 12:19:47 UTC
Description of problem:
Having following /etc/snmp/snmpd.conf file, if snmpd fails to bind the specified clientaddr port, it quietly uses random port instead. It should at least report some error to system log.

rocommunity public
[snmp] clientaddr 127.0.0.1:30000
trapsink localhost public

Version-Release number of selected component (if applicable):
net-snmp-5.3.2.2-18

How reproducible:
always

Steps to Reproduce:
1. vi /etc/snmp/snmpd.conf
2. nc -ul localhost 30000 (or have SELinux in enforcing mode)
3. service snmpd start
  
Actual results:
- traps are sent from random port and not from port 30000, which is taken by 'nc'
- system log is empty

Expected results:
- system log should show an error

Comment 1 Jan Safranek 2012-07-17 12:21:16 UTC
Look at upstream's snmplib/transports/snmpUDPIPv4BaseDomain.c:190

    /* Retry with port = 0 */
    client_addr.sin_port = 0;

Comment 2 Jan Safranek 2012-08-07 08:03:49 UTC
This bug is in the same code as regression #845974, it makes sense to fix them together.

Comment 3 RHEL Program Management 2012-08-07 08:09:06 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 4 Jan Safranek 2012-08-07 08:10:27 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
This is regression found in internal build, it has not been released. No documentation needed.

Comment 11 errata-xmlrpc 2013-01-08 05:03:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0124.html