buglwIP - A Lightweight TCP/IP stack - Bugs: bug #49292, IP_HLEN seems to be incorrect in...

 
 

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

bug #49292: IP_HLEN seems to be incorrect in ip4.h

Submitter:  Michael Bechard <mtbowler416>
Submitted:  Fri 07 Oct 2016 02:32:57 PM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Change Request Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Fri 07 Oct 2016 02:37:41 PM UTC, comment #1: 

Your port does not seem to correctly implement struct packing. Triple check this - sizeof(struct ip_hdr) MUST BE 20 - you won't get far without this working correctly.

See https://en.wikipedia.org/wiki/IPv4#Header
-> header (without options) is 20 bytes

Dirk Ziegelmeier <dziegel>
Group administrator
Fri 07 Oct 2016 02:32:57 PM UTC, original submission:  

In file src/include/lwip/prot/ip4.h, IP_HLEN is defined as 20, and the comment right above this line says it should be the same as "sizeof(struct ip_hdr)". However, sizeof(struct ip_hdr) returns 28, which is also the value I get when counting up the bytes in the ip_hdr definition.

I noticed this when using a udp packet for TFTP, and realized the udp_hdr destination port was being overwritten. Changing the length to 28 fixes this.

Michael Bechard <mtbowler416>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by mtbowler416 (Submitted the item)
  • -email is unavailable- added by mtbowler416
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-07 dziegel StatusNone Invalid
        Open/ClosedOpen Closed
    2016-10-07 mtbowler416 Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code