Undocumented netgraph `cmd' flags ?

Arnaud Lacombe lacombar at gmail.com
Wed Nov 2 06:24:41 UTC 2011


Hi,

On Tue, Nov 1, 2011 at 1:31 AM, Julian Elischer <julian at 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,
>>  - 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 other
> 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) that
> I really don't remember.
>


More information about the freebsd-net mailing list