Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(372)

Issue 7480046: code review 7480046: net: never use backlog > 65535 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by rsc
Modified:
11 years, 1 month ago
Reviewers:
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

net: never use backlog > 65535 The system call takes an int, but the kernel stores it in a uint16. At least one Linux system sets /proc/sys/net/core/somaxconn to 262144, which ends up being 0 in the uint16. Avoid being tricked. FreeBSD sources also store the backlog in a uint16. Assume the problem is systemic and fix it everywhere. Fixes issue 5030.

Patch Set 1 #

Patch Set 2 : diff -r 7b6b3b170d9a https://code.google.com/p/go/ #

Patch Set 3 : diff -r 7b6b3b170d9a https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -0 lines) Patch
M src/pkg/net/sock_bsd.go View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/net/sock_linux.go View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/net/sock_windows.go View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 1 month ago (2013-03-12 05:32:29 UTC) #1
bradfitz
LGTM nice. On Mon, Mar 11, 2013 at 10:32 PM, <rsc@golang.org> wrote: > Reviewers: golang-dev1, ...
11 years, 1 month ago (2013-03-12 05:35:41 UTC) #2
rsc
11 years, 1 month ago (2013-03-12 05:48:56 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=d515b37f8bb5 ***

net: never use backlog > 65535

The system call takes an int, but the kernel stores it in a uint16.
At least one Linux system sets /proc/sys/net/core/somaxconn
to 262144, which ends up being 0 in the uint16. Avoid being tricked.

FreeBSD sources also store the backlog in a uint16.
Assume the problem is systemic and fix it everywhere.

Fixes issue 5030.

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7480046
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b