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

Submitted by:  Michael Bechard <mtbowler416>
Submitted on:  Fri 07 Oct 2016 02:32:57 PM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Change RequestStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned 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>
Project Member
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>

 

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 dziegel (Posted a comment)
  • -unavailable- added by mtbowler416 (Submitted the item)
  • -unavailable- added by mtbowler416
  •  

    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 07 Oct 2016 02:37:41 PM UTCdziegelStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Fri 07 Oct 2016 02:32:57 PM UTCmtbowler416Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1