Bug 862286 - If portmapper is killed it cannot be restarted, responds with: "cannot bind udp: Address already in use"
Summary: If portmapper is killed it cannot be restarted, responds with: "cannot bind ...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: portmap
Version: 5.10
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-02 14:29 UTC by Kyle Squizzato
Modified: 2018-11-29 20:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-01 08:37:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Set socket option SO_REUSEADDR (1.46 KB, patch)
2012-10-02 14:29 UTC, Kyle Squizzato
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 80783 0 None None None Never

Description Kyle Squizzato 2012-10-02 14:29:44 UTC
Created attachment 620313 [details]
Set socket option SO_REUSEADDR

Description of problem:
When another machine or device queries port 111 portmapper is killed, upon restarting it responds with the error: 

cannot bind udp: Address already in use


Version-Release number of selected component (if applicable):
portmap-4.0-65.2.2.1.x86_64  


How reproducible:
Always

Steps to Reproduce:
1) on terminal A: service portmap start
2) on terminal B: telnet localhost 111
3) on terminal A: service portmap restart
  
Actual results:
- portmap gets killed
- telnet session gets closed
- portmap can not be restarted: "cannot bind udp: Address already in use"

Expected results:
portmap restarts properly 


Additional info:
- Trying to start portmap manually fails as well.
- netstat does not show any port 111 in use.

If you wait to issue the portmap start it will eventually start due to a timeout

# netstat -np | grep 111
tcp        0      0 127.0.0.1:111               127.0.0.1:50306             TIME_WAIT   -                   
tcp        0      0 192.168.130.11:56334        192.168.130.11:111          TIME_WAIT   -                   


Note that the error message mentions UDP, telnet uses TCP. This is actually a copy/paste error in the portmap sources. On an error while binding the TCP-socket, the message mentions UDP wrongly.

Attached patch sets the socket option SO_REUSEADDR (man 7 socket). This should allow portmap to bind to the address that is kept in-use by the TIME_WAIT.

Comment 1 RHEL Program Management 2013-05-01 07:13:50 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 2 Niels de Vos 2013-05-01 08:37:56 UTC
There are currently no customers interested in seeing this fixed in RHEL-5. If you are in need of this problem to be solved, please open a support case to inform Red Hat Global Support Services:
- https://access.redhat.com/support/cases/new


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