buglwIP - A Lightweight TCP/IP stack - Bugs: bug #36471, ppp_oe.c is using sizeof(struct...

 
 

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

bug #36471: ppp_oe.c is using sizeof(struct eth_hdr) instead of SIZEOF_ETH_HDR

Submitted by:  Sylvain Rochet <gradator>
Submitted on:  Tue 15 May 2012 10:35:02 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Tue 15 May 2012 08:49:18 PM UTC, comment #2:

Oh!, I did not see the padding at the -beginning- of the structure definition, of course it makes sense to be front-padded in this case :-)

Of course, lwIP won't work with compilers that do not support structure packing.

Sorry about this superflous bug report.

Sylvain Rochet <gradator>
Project Member
Tue 15 May 2012 07:55:42 PM UTC, comment #1:

I don't think it makes a difference. If you look at the definition of struct eth_hdr in etharp.h, you see it already includes an u8_t array of ETH_PAD_SIZE (before the actual header). Being like that, sizeof(struct eth_hdr) and ETH_PAD_SIZE should yield the same values.

Actually, I don't know myself what should be the difference between those two. Using ETH_PAD_SIZE has the advantage of giving a correct result if your compiler doesn't support structure packing. But then again, using such a compiler, lwIP won't work anyway... But maybe this was the original author's intention.

Simon Goldschmidt <goldsimon>
Project Administrator
Tue 15 May 2012 10:35:02 AM UTC, original submission:

Hi,

ppp_oe.c is using sizeof(struct eth_hdr) everywhere instead of SIZEOF_ETH_HDR, which seem wrong.

However, this is just by reading the source, my driver does not support ETH_PAD_SIZE yet.

If this is wrong, I will do a patch :-)

Sylvain

Sylvain Rochet <gradator>
Project Member

 

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 gradator (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 May 2012 08:49:18 PM UTCgradatorStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1