Bug 840861 - snmpd does not report error when clientaddr <ip>:<port> cannot bind to the specified port
Summary: snmpd does not report error when clientaddr <ip>:<port> cannot bind to the sp...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: net-snmp
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Safranek
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks: 886468 1086925 1877375
TreeView+ depends on / blocked
 
Reported: 2012-07-17 12:19 UTC by Jan Safranek
Modified: 2020-09-09 13:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
This is regression found in internal build, it has not been released. No documentation needed.
Clone Of:
: 886468 1877375 (view as bug list)
Environment:
Last Closed: 2013-01-08 05:03:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0124 0 normal SHIPPED_LIVE Moderate: net-snmp security and bug fix update 2013-01-08 09:22:53 UTC

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


Note You need to log in before you can comment on or make changes to this bug.