From owner-freebsd-net@FreeBSD.ORG Wed Nov 2 06:24:41 2011 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 65B35106566B; Wed, 2 Nov 2011 06:24:41 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id CD1318FC08; Wed, 2 Nov 2011 06:24:40 +0000 (UTC) Received: by wyg36 with SMTP id 36so1418329wyg.13 for ; Tue, 01 Nov 2011 23:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=uFII4oLw2YvdT6vn7xTQx8BClMfEzo728mXCAXdilkM=; b=XX1U9eocHeh7C4rEoG02eG5X2fgEDpu6bOb6Ufu8B2NSBsX0i9euxvDQ4M8keCb+Pm V27IeGVkke+Xxs1ZsFeMVb7GikQXY/mNuEF4bn3CWxT1xQdXdf+Ed09I8Mf9ahV+LGZw 9mzRMbWeqnMKUJIEQ/FOnhfyNHSzxV+s2d/Hs= MIME-Version: 1.0 Received: by 10.216.198.213 with SMTP id v63mr5383832wen.98.1320215079549; Tue, 01 Nov 2011 23:24:39 -0700 (PDT) Received: by 10.180.94.106 with HTTP; Tue, 1 Nov 2011 23:24:39 -0700 (PDT) In-Reply-To: <4EAF842D.3080909@freebsd.org> References: <4EAF842D.3080909@freebsd.org> Date: Wed, 2 Nov 2011 02:24:39 -0400 Message-ID: From: Arnaud Lacombe To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: Undocumented netgraph `cmd' flags ? 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: Wed, 02 Nov 2011 06:24:41 -0000 Hi, On Tue, Nov 1, 2011 at 1:31 AM, Julian Elischer wrote: > On 10/31/11 4:16 PM, Arnaud Lacombe wrote: >> >> Hi Julian, >> >> For my information, is it documented anywhere that bit 28[0] and 29[1] >> of Netgraph message's `cmd' shall not be used (the bits, not the >> macros) ? >> >> Thanks, >> =A0- Arnaud >> >> [0]: NGM_READONLY >> [1]: NGM_HASREPLY >> > Not really sure what you are asking. > I may have turned the question in "why undocumented flags forbids me to use the full `int' range, as netgraph internals are using those bits for their internal mambo-jumbo, which is completely against POLA ?" > NGM_READONLY allows the base system to use a reader lock and not block ot= her > traffic while the message is bring processed. > NGM_HASREPLY is not used that I can see in the kernel. It may be a > historical artifact or > maybe only used in the library as a hint. > Well, I'm sorry, but this interface _sucks_. Now, I don't really know if I should thanks you for the misdesign, the undocumented behavior, or just for having costed me a whole afternoon trying to figure out why my program ended up not completing after sending `__INT_MAX-1' as a command :/ Anyway, we're stuck with that ABI. I'll try to see if I can find a way to document this in netgraph(4). - Arnaud > It has been so long since I was involved with netgraph (over a decade) th= at > I really don't remember. >