Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Sep 1999 09:41:54 +0400 (MSD)
From:      Stas Kisel <stas@sonet.crimea.ua>
To:        jared@puck.nether.net, stas@sonet.crimea.ua
Cc:        avalon@coombs.anu.edu.au, freebsd-hackers@FreeBSD.ORG, freebsd-security@FreeBSD.ORG
Subject:   Re: mbuf shortage situations
Message-ID:  <199909100541.JAA13107@sonet.crimea.ua>
In-Reply-To: <19990909110720.A6694@puck.nether.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> From jared@puck.nether.net Thu Sep  9 18:10:06 1999

> 	I am creating about 100 icmp sockets, and as they are
> created, allocate a very large SO_RCVBUF:
>         (void)setsockopt(localstruct->icmp_s, SOL_SOCKET,
>                 SO_RCVBUF, (char *)&hold, sizeof(hold));

This can be a part of the problem too.

setsockopt() have to check if there is really free memory for buffer and
set an appropriate, described in man page errno if failed.

In my test, 2.2.7 kernel allowed me to "allocate" in this way 15M "for buffers"
on a 32M machine (NMBCLUSTERS=1024, maxusers=50). Probably it could
allow more, but I thought 15M is too much anyways.
There is a limitation - buffer can not be bigger than ~240k. I did
not checked which errno setsockopt() returns, but I didn't found
anything appropriate in a man page.


--
Stas Kisel. UNIX, security, C, TCP/IP, Web. UNIX - the best adventure game
http://www.tekmetrics.com/transcript.shtml?pid=20053 http://www.crimea.edu
+380(652)510222,230238 ; stas@crimea.edu stas@sonet.crimea.ua ; 2:460/54.4



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909100541.JAA13107>