Skip to contentSkip to conversation

New: SO_RCVBUF and SO_SNDBUF must be set before connect() or listen()

Bugme-new Andrew Morton 1 participant 1 message Mar 12, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 31 lines · On Thu, 12 Mar 2009 10:23:52 -0700 (PDT) [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id=12860

           Summary: SO_RCVBUF and SO_SNDBUF must be set before connect() or
                    listen()
           Product: Networking
           Version: 2.5
     KernelVersion: 2.6.18
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
        AssignedTo: [email protected]
        ReportedBy: [email protected]

Problem Description:

Calling setsockopt() with SO_RCVBUF or SO_SNDBUF after connect() or listen() makes sockets have a horrible performance. Moreover, getsockopt() returns values as if the previous setsockopt() was successful.

Solution:

1) Document this somewhere in the man-pages (e.g. socket(7))
2) Make setsockopt() fail after connect() or listen()

If you need an example code, I'll be happy to provide it.