lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Reassembles incoming IP crash my system


From: Amir Bukhari
Subject: RE: [lwip-users] Reassembles incoming IP crash my system
Date: Tue, 28 Mar 2006 14:52:49 +0200

Thank you for the info.
It help a lot, as I force my compiler to not assume that alignment are
handled by CPU. 
I do not wait for such exception with my software. I write a realtime OS
which do not handle this exception, because all process are running in super
user mode (like kernel module) and it is not allowed to have alignment
issues. 
Therefor it is better to catch such failure during development.

-Amir

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Derek
Guerdon
Sent: Tuesday, March 21, 2006 8:35 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Reassembles incoming IP crash my system

On Tue, 21 Mar 2006 16:51:12 +0100, Amir wrote:

>It was alignment issue, I have used 4 byte alignment and thus case 
>alignment exception (PPC) to occure.
>In one machine of two machine, which has MPC5200, an alignment 
>exception is occure and in the other is just crash, before the 
>exception run, I don't know why.
>But as I used 2 byte alignment it work as expected.
>
>-Amir
>
>> I am using lwip under mpc5200 and it work fine, until a client send a 
>> big
>IP
>> packet. In this case the lwip crash on
>> Ip_frag.c: line 263
>> memcpy(q->payload, &ip_reassbuf[i],
>>             q->len > ip_reasslen - i ? ip_reasslen - i : q->len);
>>
>> Then I disable reasemble big IP in lwipopts.h, so that such packets 
>> will
>be
>> droped.
>>
>> It crash in my case by using "ping" like:
>>
>> Ping host -s 1524
>>
>> Is that a bug or I have may forgot something?
>

It sounds like your problem is alignment of reassbuf. Below is a diff that
should force your compiler to align the buffer on the correct boundary. 

Please note that there are also issues of this same sort in mem.c, memp.c,
and pbuf.c.

Hope this helps:

Index: ip_frag.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/ip_frag.c,v
retrieving revision 1.21
diff -r1.21 ip_frag.c
80c80,87
< static u8_t ip_reassbuf[IP_HLEN + IP_REASS_BUFSIZE];
---
> static union
> {
>   struct ip_hdr hdr;
>   u8_t buf[IP_HLEN + IP_REASS_BUFSIZE]; } reass_mem;
> 
> #define ip_reassbuf reass_mem.buf
> 

--
Derek Guerdon



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

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