Netgraph message size limitation.

Arnaud Lacombe lacombar at gmail.com
Tue Mar 27 16:58:05 UTC 2012


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


More information about the freebsd-net mailing list