mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manfred Bartz <mbartz@optushome.com.au>
To: linux-kernel@vger.kernel.org
Subject: setsockopt(..,SO_RCVBUF,..) sets wrong value
Date: 02 Aug 2001 20:34:47 +1000	[thread overview]
Message-ID: <20010802103447.992.qmail@optushome.com.au> (raw)

When I do a setsockopt(..,SO_RCVBUF,..) and then read the value back
with getsockopt(), the reported value is exactly twice of what I set.

Running the same code on Solaris and on DEC UNIX reports back the
exact size I set.

Looking at the code it seems that the  *2  should not be there:

>From /usr/src/linux/net/core/sock.c:

int sock_setsockopt(...

		case SO_SNDBUF:

			sk->sndbuf = max(val*2,SOCK_MIN_SNDBUF);

		case SO_RCVBUF:
			/* FIXME: is this lower bound the right one? */
			sk->rcvbuf = max(val*2,SOCK_MIN_RCVBUF);
			break;


-- 
Manfred Bartz

             reply	other threads:[~2001-08-02 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-02 10:34 Manfred Bartz [this message]
2001-08-02 13:12 ` David S. Miller
     [not found] <no.id>
2001-08-02 14:26 ` Alan Cox
2001-08-02 14:38 Andries.Brouwer
2001-08-02 15:59 ` Richard B. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010802103447.992.qmail@optushome.com.au \
    --to=mbartz@optushome.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®