buglwIP - A Lightweight TCP/IP stack - Bugs: bug #20259, udp.h/udp_hdr struct definition...

 
 

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

bug #20259: udp.h/udp_hdr struct definition incorrect

Submitted by:  Thomas Taranowski <taranowski>
Submitted on:  Mon 25 Jun 2007 08:53:24 PM UTC  
 
Category: UDPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: None

Tue 26 Jun 2007 07:34:51 AM UTC, comment #1:

Certainly. I've integrated it in CVS, thanks. Although it would only make a difference if e.g. on a 32-bit platform, the udp_hdr is not 16-bit aligned. And accessing the members does get slower with a packed struct for most platforms. Still, to be portable this has to be packed!

Closing as fixed.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 25 Jun 2007 08:53:24 PM UTC, original submission:

Patch attached.

The definition of the udp_hdr struct does not include the correct packing pre/postamble.

+
/* Fields are (of course) in network byte order. */
+#ifdef PACK_STRUCT_USE_INCLUDES
+# include "arch/bpstruct.h"
+#endif
+PACK_STRUCT_BEGIN
struct udp_hdr {
PACK_STRUCT_FIELD(u16_t src);
PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */
PACK_STRUCT_FIELD(u16_t len);
PACK_STRUCT_FIELD(u16_t chksum);
} PACK_STRUCT_STRUCT;
+PACK_STRUCT_END
+#ifdef PACK_STRUCT_USE_INCLUDES
+# include "arch/epstruct.h"
+#endif

Thomas Taranowski <taranowski>
Project Member

 

Attached Files
file #13165:  udp.packed.patch added by taranowski (829B - text/x-patch)

 

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 taranowski (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 26 Jun 2007 07:34:51 AM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Mon 25 Jun 2007 08:53:24 PM UTCtaranowskiAttached File-=>Added udp.packed.patch, #13165

    Back to the top


    Powered by Savane 3.1-cleanup1