From owner-freebsd-net@FreeBSD.ORG Tue Mar 27 21:20:47 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B1A9106566B for ; Tue, 27 Mar 2012 21:20:47 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5F9398FC21 for ; Tue, 27 Mar 2012 21:20:47 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id q2RLJ8Kf065262 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 27 Mar 2012 14:19:09 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4F722EE7.50102@freebsd.org> Date: Tue, 27 Mar 2012 14:19:35 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Arnaud Lacombe References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Net Subject: Re: Netgraph message size limitation. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2012 21:20:47 -0000 On 3/27/12 9:58 AM, Arnaud Lacombe wrote: > Hi Julian, > > In `sys/netgraph/ng_base.c', there is the following: > > static int > ng_generic_msg(node_p here, item_p item, hook_p lasthook) > { > case NGM_BINARY2ASCII: > { > int bufSize = 20 * 1024; /* XXX hard coded constant */ > [...] > case NGM_ASCII2BINARY: > { > int bufSize = 2000; /* XXX hard coded constant */ > > I put on the side the reasoning behind archie@ bump of one value and > not the other 12 years ago. What I would like to know is why use > harcoded, undocumented, limits. It seems to me that there is no way > the code can do anything clever at this point wrt. size of the data > coming in or out. All the allocation and buffer management should be > done by the parser. If my type specify a 512 32bits array, I should be > to pass this array. Thought ? I have no real thoughts because Archie did the parser and I didn't really touch it. However given that Netgraph was written for a specific set of jobs and that since then people seem to have found all sorts of other things to do with it, it is quite possible that we should revisit these limits. regardless, they should probably be in the documentation.. I hope to get back to BSD work one of these years.. Until then, "patches accepted".. > Thanks, > - Arnaud >