From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5844 invoked by alias); 13 Jun 2007 13:36:30 -0000 Received: (qmail 5834 invoked by uid 22791); 13 Jun 2007 13:36:29 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Jun 2007 13:36:26 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1HyT1G-0000qu-00; Wed, 13 Jun 2007 15:36:18 +0200 Date: Wed, 13 Jun 2007 15:44:00 -0000 To: J?rgen Lambrecht Cc: Andrew Lunn , Juergen Lambrecht , ecos-discuss@ecos.sourceware.org Message-ID: <20070613133618.GA1044@lunn.ch> Mail-Followup-To: J?rgen Lambrecht , Andrew Lunn , Juergen Lambrecht , ecos-discuss@ecos.sourceware.org References: <466EC08A.8090704@televic.com> <20070612160753.GP26816@lunn.ch> <466EF583.2090003@telenet.be> <20070612215839.GX26816@lunn.ch> <466FEF53.1060909@televic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <466FEF53.1060909@televic.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] max IP packet size = 9216 B. Why? X-SW-Source: 2007-06/txt/msg00143.txt.bz2 On Wed, Jun 13, 2007 at 03:21:23PM +0200, J?rgen Lambrecht wrote: > Thanks Andrew! This solves it. > So the maximum supported IP packet size for an UDP socket is a > configuration option. But you must be a TCP/IP networking expert to know > about the option.. Not really, see man 7 socket. It is also in Steven's book. > >SO_SNDBUF & SO_RCVBUF. However, there might be a system check to > >ensure they are not too large. > How can you know wat the allowed maximum is? I guess that is the value of > so->so_snd.sb_mbmax that was set default to 73728 (as I saw with the > debugger). The check is: if ((u_quad_t)cc > (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES)) return (0); sb_max has the value SB_MAX, which is (256*1024) MCLBYTES is (1 << MCLSHIFT) MCLSHIFT is 11 MSIZE is 128 So that boils down to (256*1024) * (1 << 11) / (128 + (1<<11) 262144 * 2048 / (2176) 246723 However, there might be another check somewhere else.... As you said, setsockopt should return an error, so you could binary chop. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss