[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] use of static variables in tcp_in.c
From: |
Kieran Mansley |
Subject: |
RE: [lwip-users] use of static variables in tcp_in.c |
Date: |
Thu, 04 Oct 2007 08:38:29 +0100 |
On Thu, 2007-10-04 at 09:21 +0200, Goldschmidt Simon wrote:
> > tcp_in.c in lwIP 1.2.0 makes use of static global variables to pass
> > arguments between functions. This implies that tcp_input is not
> re-entrant.
> > However this doesn't seem to be documented in ethernetif.c or anywhere
> else.
> > Is there something I'm missing here?
>
> Does it have to be documented in ethernetif.c? Why would you call
> tcp_input
> more than once? That would mean you would call tcp_input (or maybe
> netif->input)
> from your netif->output function (which may be called in tcp_input).
> That is
> not allowed in RAW mode (API mode puts that packet on a queue only, so
> the function
> is not really called again). This is documented, for example in
> loopif.c. Maybe
> it should be documented better...
That said, is there any compelling reason to use static global variables
rather than function arguments?
Kieran