buglwIP - A Lightweight TCP/IP stack - Bugs: bug #26487, igmp_ip_output_if uses IP_HDRINCL...

 
 

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

bug #26487: igmp_ip_output_if uses IP_HDRINCL at the wrong place

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Thu 07 May 2009 06:09:09 PM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Tue 12 May 2009 07:52:55 PM UTC, comment #2:

It won't (shouldn't) optimize it without static and/or const.

Bill Auerbach <billauerbach>
Tue 12 May 2009 06:00:58 PM UTC, comment #1:

As noone objected, I've added ip_output_if_opt() that adds the 2 arguments void* ip_options and u16_t optlen to ip_output_if(). This function is only preprocessor-enabled if LWIP_IGMP=1, so the impact on the rest should be minimal (had to create an u16_t ip_hlen=IP_HLEN, but a good compiler can optimize that away as a constant anyway).

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 07 May 2009 06:09:09 PM UTC, original submission:

pbuf_header(p, IP_HLEN) is executed even if IP_HDRINCL is given, which results in a wrong payload.

The reason for posting this here and not fixing directly is I'd rather solve this more cleanly: I think we should provide a function in ip.c to include IP options in an IP header (which is what igmp_ip_output_if needs) instead of duplicating the ip_output_if code in igmp_ip_output_if.

This would both make the code smaller and prevent bugs getting fixed in one place while staying in the other. Also, the current igmp_ip_output_if code omits stats, snmp and loopback!

I'd add the function ip_output_if_options() that adds 2 arguments (void *options, int optlen) to ip_output_if().

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.

 

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 billauerbach (Posted a comment)
  • -unavailable- added by goldsimon (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 12 May 2009 06:00:58 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1