buglwIP - A Lightweight TCP/IP stack - Bugs: bug #2004, Filter in ip_input accepts packet...

 
 

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

bug #2004: Filter in ip_input accepts packet when any netif has 0 address

Submitted by:  David Haas <davidhaas>
Submitted on:  Tue 17 Dec 2002 03:39:43 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: None

Wed 18 Dec 2002 10:39:15 AM UTC, comment #2:

The reason 0.0.0.0 is passed is that we must accept packets for the DHCP negotiation process for any unconfigured interface. The filter is not restrictive enough though.

Leon Woestenberg <likewise>
Project Member
Tue 17 Dec 2002 03:44:40 PM UTC, comment #1:

Here is pseudo code which I think will fix this problem:

netif = null
for netif list:
if address match or broadcast match netif is set
if netif is still null
Test for dhcp
else (dhcp)
forward packet

Do we really need to test for an interface with a zero address? I notice that the DHCP code is setting netif to inp, so we are ultimately ignoring the zero interface. Let the DHCP high-level protocol ignore the unwanted DHCP packet if it get's one and we did not initiate a request.

David Haas <davidhaas>
Project Member
Tue 17 Dec 2002 03:39:43 PM UTC, original submission:

The following code checks if a packet is for us in ip_input:

if(ip_addr_isany(&(netif->ip_addr)) ||
ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr)) ||
(ip_addr_isbroadcast(&(iphdr->dest), &(netif->netmask)) &&
ip_addr_maskcmp(&(iphdr->dest), &(netif->ip_addr), &(netif->netmask))) ||
ip_addr_cmp(&(iphdr->dest), IP_ADDR_BROADCAST)) {
break;
}

Why is one of the criteria ip_addr_isany(&(netif->ip_addr)) ?

This says that if our address is 0.0.0.0 we will take any packet and process it as if it is for us. A netif which has a wrongly initialized or configured ip address is likely to be 0.0.0.0. In fact, I think we should ignore any interface with address 0.0.0.0.

David Haas <davidhaas>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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 28 Jan 2003 08:51:03 PM UTClikewiseStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1