Bug 862286 - If portmapper is killed it cannot be restarted, responds with: "cannot bind udp: Address already in use"
If portmapper is killed it cannot be restarted, responds with: "cannot bind ...
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: portmap (Show other bugs)
All Linux
high Severity high
: rc
: ---
Assigned To: Steve Dickson
BaseOS QE Security Team
: Patch
Depends On:
  Show dependency treegraph
Reported: 2012-10-02 10:29 EDT by Kyle Squizzato
Modified: 2013-05-01 04:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-05-01 04:37:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 80783 None None None Never

  None (edit)
Description Kyle Squizzato 2012-10-02 10:29:44 EDT
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):

How reproducible:

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                  TIME_WAIT   -                   
tcp        0      0          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 Product and Program Management 2013-05-01 03:13:50 EDT
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 04:37:56 EDT
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.