lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: [lwip] weird piece of code in etharp since 0.5.3+ ??


From: Martin Glunz
Subject: [lwip-users] Re: [lwip] weird piece of code in etharp since 0.5.3+ ??
Date: Thu, 09 Jan 2003 00:50:38 -0000

address@hidden wrote:
> 
> Hello,
> 
> I came across something weird which seems to be in lwIP since 0.5.3 or so:
> 
> etharp.c/etharp_output() contains this piece of code:
> 
>   }
>   else {
>     if(!ip_addr_maskcmp(ipaddr, &(netif->ip_addr), &(netif->netmask))) {
>       ipaddr = &(netif->gw);
>     }
> 
> It seems to send a packet to the default gateway if its address is not on
> the
> local network.
> 
> Now, shouldn't this decision be made in the IP layer _only_? I.e. the
> packet should not be output on this interface in the first place.
> 

I've seen this too. It works if there is only one interface, I never
tested more than one interface on my target system.
Problem is that only the mac address of the default gw must be placed
in the packet, the destination IP must be preserved, and inside
etharp.c it seems to be a good place to do so (for a quick hack,
i guess).
I never analyzed the ip_route code, so I can't tell if it is easily
possible to move this code there, but I think it is the right way to
handle the default gw in ip_route.


Martin Glunz


fortune says today:
Swipple's Rule of Order:
        He who shouts the loudest has the floor.

WANTED: Schrödinger's Cat. Dead or Alive.

There are only 10 kinds of people. Those who
understand binary and those who don't.
[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]