Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2012 12:58:03 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        Julian Elischer <julian@freebsd.org>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Netgraph message size limitation.
Message-ID:  <CACqU3MW1Fywj7r%2BC-trmMB88X=jDft9D1azN7G_Vt2xT-FZ=zw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MW1Fywj7r%2BC-trmMB88X=jDft9D1azN7G_Vt2xT-FZ=zw>