lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LCP Termination Request steps


From: Sylvain Rochet
Subject: Re: [lwip-users] LCP Termination Request steps
Date: Mon, 4 Jun 2012 22:07:28 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Nick,


On Mon, Jun 04, 2012 at 02:21:38PM +0300, N.Karakotas wrote:
> Nice,
> 
> Can we strip away some of the debug stuff, as I see it has a 1024 buffer.

Yeah, I already noticed the "char buf[1024];" in the logit() function, 
which is a huge stack requirement.

PPPd for sure require an heavy work concerning stack and globals 
requirements reduction, which are way too much for small embedded 
devices.


> Also  from an older post:
> /* @todo: do we really need such a large buffer? The typical 1500
> bytes seem too much. */
> static u_char nak_buffer[PPP_NACK]; /* where we construct a nak packet */
> 
> #define PPP_NACK                                              8
> 
> This works. 2K+ saved already!

It depends on the number of options we need to NAK, 8 bytes is probably 
too short.

Anyway, setting nak_buffer below PPP_MRU is not as easy as just reducing 
the buffer size. With nak_buffer size >= PPP_MRU, we don't need to check 
for buffer overflow, because it just can't happen. With nak_buffer size 
< PPP_MRU, we absolutely need to check for buffer overflow.


Sylvain

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]