[Top][All Lists]

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

Re: [lwip-users] LCP fails to negotiate options continuously after many

From: Andrew Westberg
Subject: Re: [lwip-users] LCP fails to negotiate options continuously after many previous successes
Date: Sun, 18 May 2014 08:16:26 -0400


What you said about the packed structures makes sense. Thanks again.

- Andrew Westberg

On Sun, May 18, 2014 at 8:02 AM, Sylvain Rochet <address@hidden> wrote:
Hello Andrew,

On Sun, May 18, 2014 at 07:36:06AM -0400, Andrew Westberg wrote:
> It's been running for over 15 hours on ppp_new without issue. I'd say the
> issue is solved.

Yeah!, happy to hear that.

> There may still be a bug in ppp.c with these two lines around 1762 if the
> platform isn't/can't support packed structs.
>               *(payload++) = pcrx->in_protocol >> 8;
>               *(payload) = pcrx->in_protocol & 0xFF;
> In the old ppp, these fields are set by fields after first casting to a
> header struct so packed or not makes no difference.

I have to disagree. byte access is the only way to escape from alignment
issues, this is what your compiler do for packed struct if your target
does not support unaligned access for short and long.

This is why all structures that are going to be used in buffers are
packed in lwIP, because the structure might be set to an unaligned
address in the buffer.

Anyway, lwIP is not designed to work with compilers that does not
support packed structures.

> Thanks for all your help!

You're welcome :)


lwip-users mailing list

reply via email to

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