Skip to contentSkip to conversation

New: shutdown(2) does not fully shut down socket any more

Bug 32832 Stephen Hemminger 3 participants 4 messages Apr 6, 2011 – Apr 8, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Begin forwarded message:

Date: Wed, 6 Apr 2011 22:42:39 GMT
From: [email protected]
To: [email protected]
Subject: [Bug 32832] New: shutdown(2) does not fully shut down socket any more

https://bugzilla.kernel.org/show_bug.cgi?id=32832

           Summary: shutdown(2) does not fully shut down socket any more
           Product: Networking
           Version: 2.5
    Kernel Version: 2.6.38
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
        AssignedTo: [email protected]
        ReportedBy: [email protected]
        Regression: Yes

In 2.6.35 and earlier, shutdown(2) will fully remove a socket. This does not appear to be true any more and is causing software to misbehave.

2.6.35:

$ ./testcase
parent: 5957
before:
tcp        0      0 0.0.0.0:12345           0.0.0.0:*               LISTEN     
after:
child: 5961
$ ./testcase
parent: 6001
before:
tcp        0      0 0.0.0.0:12345           0.0.0.0:*               LISTEN     
after:
child: 6002

2.6.38:

$ ./testcase
parent: 1138
before:
tcp        0      0 0.0.0.0:12345           0.0.0.0:*               LISTEN     
after:
child: 1142
$ ./testcase
bind: Address already in use

The listener doesn't show up in netstat any more, but as long as the child process is running, the socket is unavailable. It is as if the shutdown(2) behavior has partially reverted to close(2) behavior (but in the case of using close(2), the child's socket would remain visible in netstat).

Signature · 6 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


-- 
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Wed, 6 Apr 2011 16:07:13 -0700

Quoted 11 lines

Begin forwarded message:

Date: Wed, 6 Apr 2011 22:42:39 GMT
From: [email protected]
To: [email protected]
Subject: [Bug 32832] New: shutdown(2) does not fully shut down socket any more

https://bugzilla.kernel.org/show_bug.cgi?id=32832

Summary: shutdown(2) does not fully shut down socket any more

...

Quoted 4 lines

In 2.6.35 and earlier, shutdown(2) will fully remove a socket. This does not appear to be true any more and is causing software to misbehave.

This is already being discussed:

http://marc.info/?l=linux-netdev&m=130176733401613&w=2

#2 lore raw
Quoted 16 lines · David Miller

From: Stephen Hemminger <[email protected]>
Date: Wed, 6 Apr 2011 16:07:13 -0700

Quoted 11 lines

Begin forwarded message:

Date: Wed, 6 Apr 2011 22:42:39 GMT
From: [email protected]
To: [email protected]
Subject: [Bug 32832] New: shutdown(2) does not fully shut down socket any more

https://bugzilla.kernel.org/show_bug.cgi?id=32832

Summary: shutdown(2) does not fully shut down socket any more

...

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

In 2.6.35 and earlier, shutdown(2) will fully remove a socket. This does not appear to be true any more and is causing software to misbehave.

This is already being discussed:

http://marc.info/?l=linux-netdev&m=130176733401613&w=2

Status update : I'll take time this week end to work on this and find a solution.

Thanks