lwip-users
[Top][All Lists]
Advanced

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

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


From: leon . woestenberg
Subject: [lwip-users] [lwip] weird piece of code in etharp since 0.5.3+ ??
Date: Thu, 09 Jan 2003 00:09:16 -0000

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 think this is ip_route()'s job:

  if((netif = ip_route(dest)) == NULL) {
    DEBUGF(IP_DEBUG, ("ip_output: No route to 0x%lx\n", dest->addr));
    return ip_output_if(p, src, dest, ttl, proto, netif);


Regards,

Leon Woestenberg.

p.s. In recent versions, this piece of code was fixed to actually check if
a default gateway was
configured (!= 0).

[This message was sent through the lwip discussion list.]




reply via email to

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