buglwIP - A Lightweight TCP/IP stack - Bugs: bug #31568, ip_forward() have a faulty...

 
 

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

bug #31568: ip_forward() have a faulty behaviour.

Submitted by:  hanhui <hanhui03>
Submitted on:  Sat 06 Nov 2010 03:31:43 PM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Faulty BehaviourStatus: Invalid
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Sat 20 Nov 2010 05:56:13 PM UTC, comment #1:

I think that's a fundamental question:
a) what you want is not a proxy: a proxy is an application-level program (osi level 7) that is implemented using sockets or tcp PCBs
b) using ip_forward to send back a packet on the input netif would effectively mean that we can reach a remote host on a network where another host couldn't and used us as a gateway. To me, that does not make sense.

I could understand your intention if you had multiple IP addresses on one netif - in that case, ip_forward could send back the packet on the same hardware interface using a different subnet. However, since the only solution to have multiple IP addresses on one hardare interface with lwIP is using multiple netifs, the current code is OK.

If you want a realy proxy, you have to code it.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 06 Nov 2010 03:31:43 PM UTC, original submission:

I add a NAT in lwip. if I have 2 netif, one is LAN, another is WAN there is on problem.

But if I have only 1 netif, I want lwip become a network proxy server. all is OK, except ip_forward().

the following codes:

ip_forward()
{
...;
if (netif == inp) {
...;
goto return_noroute;
}
...;
}

should be:

ip_forward()
{
...;
if ((netif == inp) && !ip_addr_cmp(&iphdr->src, &netif->ip_addr)) {
...;
goto return_noroute;
}
...;
}

hanhui <hanhui03>

 

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 hanhui03 (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
    Sat 20 Nov 2010 05:56:13 PM UTCgoldsimonStatusNone=>Invalid
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1