From owner-freebsd-net@FreeBSD.ORG Tue Mar 27 16:58:05 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 7B930106564A; Tue, 27 Mar 2012 16:58:05 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id DFE2F8FC16; Tue, 27 Mar 2012 16:58:04 +0000 (UTC) Received: by wern13 with SMTP id n13so98428wer.13 for ; Tue, 27 Mar 2012 09:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=i9vGKf1+iFQH/2zeDDxaMUzNCEp4FakeR56J+UdlTyk=; b=pkCGCYzoHblDyQN8vIO4b0vc8rO7QdOY2c8KXV86+Mu9TmmdNpeZOQ0dGc3j5z3OWG fKQd77n5yTW/IWY0+R7ravYHJcrUd7FlQpUz4OrhXkL2XiE9nHabNEMagnbGwzJlbtdy AtGIxw08tG1v2GKDbxEeB+RPKrJHzTXDKENgXWfQw929q/a0UdFbt8pxGCA4hAI7ZRpU H7EQqbCvl5LEUfms+Njfs1uEzfJNp+BvxlS2wikjFK6KJRpvOcSKSMX2AguF9PdtgM5I 8kzNlIHADwEWrjyr3qY4z+np6qWVWC4ogAJxMV0/EFmgzULlWdnGPajtk0KVOrARJZe3 +dhw== MIME-Version: 1.0 Received: by 10.180.101.231 with SMTP id fj7mr29262976wib.15.1332867483831; Tue, 27 Mar 2012 09:58:03 -0700 (PDT) Received: by 10.216.225.207 with HTTP; Tue, 27 Mar 2012 09:58:03 -0700 (PDT) Date: Tue, 27 Mar 2012 12:58:03 -0400 Message-ID: From: Arnaud Lacombe To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Net Subject: 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 16:58:05 -0000 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 ? Thanks, - Arnaud