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

Submitter:  Sylvain Rochet <gradator>
Submitted:  Tue 15 May 2012 10:35:02 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned 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>
Group 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>
Group 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>
Group Member

 

(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 goldsimon (Posted a comment)
  • -email is unavailable- added by gradator (Submitted the item)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-15 gradator StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code