Bug 205154

Summary: When an invalid port number that exceeds 0x10000(65536) is specified by the snmpd and snmptrapd command, an improper port number is generated.
Product: Red Hat Enterprise Linux 4 Reporter: Jose Plans <jplans>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0738 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 16:00:17 UTC Type: ---
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: 222397, 449351    
Attachments:
Description Flags
Patch fixing the problem none

Description Jose Plans 2006-09-05 00:05:49 UTC
Description of problem:


  When an invalid port number that exceeds 0x10000(65536) is specified by the
  snmpd and snmptrapd command, an improper port number is generated.  
  
  ** port number definition: unsigned short
  
  ex.) specified number: 65537(0x10001)
   ** generated port number : 1 → 65537(0x10001) - 65536(0x10000)
  
[root@RHEL4U4]# snmpd UDP:65537,udp6:65537

[root@RHEL4U4]# lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE NODE NAME
......................................................................... ......
snmpd    24866 root    9u  IPv4  74697       TCP *:smux (LISTEN)
snmpd    24866 root   11u  IPv4  74699       UDP *:tcpmux
snmpd    24866 root   12u  IPv6  74700       UDP *:tcpmux

[root@RHEL4U4]# less /etc/services | grep tcpmux
tcpmux          1/tcp                           # TCP port service multiplexer
tcpmux          1/udp                           # TCP port service multiplexer

[root@RHEL4U4]# less /etc/services | grep smux
# (due to a bug in inetd the 3com-tsmux line is disabled)
#3com-tsmux     106/tcp         poppassd
#3com-tsmux     106/udp         poppassd
smux            199/tcp                         # SNMP Unix Multiplexer
smux            199/udp

[root@RHEL4U4]# snmptrapd TCP:65537,udp6:65537
[root@RHEL4U4]# lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE NODE NAME
......................................................................... ......
snmptrapd 24736 root    8u  IPv4  71515       TCP *:tcpmux (LISTEN)
snmptrapd 24736 root    9u  IPv6  71516       UDP *:tcpmux

[root@RHEL4U4]# less /etc/services | grep tcpmux
tcpmux          1/tcp                           # TCP port service multiplexer
tcpmux          1/udp                           # TCP port service multiplexer


Version-Release number of selected component (if applicable):
net-snmp-5.1.2-11.EL4.7

How reproducible:
Always.

Steps to Reproduce:
  
Actual results:
port 1 returned.

Expected results:
Default ports to be returned if the ports are > 65536.
[root@RHEL4U4]# snmpd UDP:65537,udp6:65537
[root@RHEL4U4]# lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE NODE NAME
......................................................................... ......
snmpd    24829 root    9u  IPv4  73300       TCP *:smux (LISTEN)
snmpd    24829 root   11u  IPv4  73302       UDP *:snmp
snmpd    24829 root   12u  IPv6  73303       UDP *:snmp


root@RHEL4U4]# snmptrapd UDP:65537,udp6:65537
[root@RHEL4U4]# lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE NODE NAME
......................................................................... ......
snmptrapd 24808 root    8u  IPv4  73197       UDP *:snmptrap
snmptrapd 24808 root    9u  IPv6  73198       UDP *:snmptrap

Additional info:
Patched attached.

Comment 1 Jose Plans 2006-09-05 00:05:50 UTC
Created attachment 135517 [details]
Patch fixing the problem

Comment 2 RHEL Program Management 2007-06-09 13:25:45 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 8 errata-xmlrpc 2007-11-15 16:00:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0738.html