lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Lwip as a router


From: Ghobad Emadi
Subject: Re: [lwip-devel] Lwip as a router
Date: Sat, 15 Mar 2014 16:18:41 +0330

Hi Simon,
Thank you very much for your reply. If you would be agree with adding LWIP_HOOK_ETHARP_GET_GW, do you agree with the following changes?
Adding LWIP_HOOK_ETHARP_GET_GW in HOOK section of opt.h and changing the following part of "etharp_output()".

{
#ifdef LWIP_HOOK_ETHARP_GET_GW 
    dst_addr = LWIP_HOOK_ETHARP_GET_GW(netif, ipaddr /* The IP address of the packet destination */ );
    if(!dst_addr) { /* no route to destination in routing table  */
#endif
       /* interface has default gateway? */
        if (!ip_addr_isany(&netif->gw)) {
          /* send to hardware address of default gateway IP address */
          dst_addr = &(netif->gw);
        /* no default gateway available */
        } else {
          /* no route to destination error (default gateway missing) */
          return ERR_RTE;
        }
#ifdef LWIP_HOOK_ETHARP_GET_GW 
    }
#endif
}


reply via email to

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