buglwIP - A Lightweight TCP/IP stack - Bugs: bug #36318, Wrong UDP data size for small...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #36318: Wrong UDP data size for small datagrams

Submitted by:  dagos <dagos>
Submitted on:  Thu 26 Apr 2012 03:51:52 PM UTC  
 
Category: UDPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Invalid
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.4.0

Fri 27 Apr 2012 12:34:23 PM UTC, comment #5:

Padding is at Ethernet level, when ethernet frame is less than 64 bytes (including CRC)

I found the (real) problem.
It is not LWIP (sorry for this post...) but my input ethernet frame which was not correct (error in IP size field).

ethernet frame (at 0x11: 0x2e):

        1. 00 30 84 89 9b 81 02 00 02 00 00 01 08 00 45 00 .0...... ......E.

0010 00 2e 1e 00 00 00 1e 11 69 a6 0a 81 00 0a 0a 81 ........ i.......
0020 00 0e 04 0e 04 fe 00 15 a0 5f 00 03 00 01 00 00 ........ ._......
0030 00 09 41 31 00 01 00 00 00 00 00 00 ..A1.... ....
instead of (at 0x11: 0x29):

        1. 00 30 84 89 9b 81 02 00 02 00 00 01 08 00 45 00 .0...... ......E.

0010 00 29 1e 00 00 00 1e 11 69 a6 0a 81 00 0a 0a 81 ........ i.......
0020 00 0e 04 0e 04 fe 00 15 a0 5f 00 03 00 01 00 00 ........ ._......
0030 00 09 41 31 00 01 00 00 00 00 00 00 ..A1.... ....

So this bug can be close, sorry.

dagos <dagos>
Thu 26 Apr 2012 06:49:49 PM UTC, comment #4:

It works for me as well. Furthermore, my Udp.c (close to if not most current) has no assignment to p->tot_len anywhere in it.

Bill Auerbach <billauerbach>
Thu 26 Apr 2012 06:39:42 PM UTC, comment #3:

Checksums are not optional for UDP either unless the sender sets the chksum field to zero.

I'm wondering what the OP means with 'UDP datagram WITH PADDING'? Small packets have always worked correctly for me...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 26 Apr 2012 06:01:22 PM UTC, comment #2:

I'm wondering if it were true for TCP, would TCP work at all? Checksums are not optional.

Bill Auerbach <billauerbach>
Thu 26 Apr 2012 04:04:26 PM UTC, comment #1:

maybe same problem for TCP ? I don't yet try it...

dagos <dagos>
Thu 26 Apr 2012 03:51:52 PM UTC, original submission:

When a UDP datagram WITH PADDING is read by LWIP, p->tot_len includes padding size.
This is wrong for 2 reasons:
- CheckSum calculation will fail (p->tot_len is used instead of UDP total size field), and the paquet is rejected (if CHECKSUM_CHECK_UDP = 1)
- Data size given by p->tot_len is wrong so more data could be read by the application.

To solve the problem, add in udp.c, l.114:
+ p->tot_len = ntohs(udphdr->len); // DELETE PADDING

dagos <dagos>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by billauerbach (Posted a comment)
  • -unavailable- added by dagos (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 27 Apr 2012 02:20:45 PM UTCgoldsimonStatusNone=>Invalid
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1