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

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Thu 07 May 2009 06:09:09 PM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group administrator

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2009-05-12 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code