Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Nov 2011 02:24:39 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        Julian Elischer <julian@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Undocumented netgraph `cmd' flags ?
Message-ID:  <CACqU3MWmo24-s%2BuUiUT8oGYCLbdh3O1%2BtZOvPOQevUK83t%2BfCw@mail.gmail.com>
In-Reply-To: <4EAF842D.3080909@freebsd.org>
References:  <CACqU3MU4-5dU-FG%2Bvq8QF=1PiCPa-tBRiYjQEmCHHHAWveLrnw@mail.gmail.com> <4EAF842D.3080909@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Tue, Nov 1, 2011 at 1:31 AM, Julian Elischer <julian@freebsd.org> 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.
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MWmo24-s%2BuUiUT8oGYCLbdh3O1%2BtZOvPOQevUK83t%2BfCw>