[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Sending to myself
From: |
Ceresoli Luca |
Subject: |
[lwip-users] Sending to myself |
Date: |
Wed, 9 Jan 2008 16:23:23 +0100 |
Hi,
I'm not sure if this is a bug or a missing feature, but here it is: lwip does
not send packets to its own IP address.
I use raw API, NO_SYS=1, lwip CVS dec 11, 2007.
I see that the code simply does not check if dest_IP == own_IP.
This leads to gratuitous ARP requests, which cannot be answered.
I think the most logical solution would be to redirect the packet up the stack
when it has reached down to the IP level. But in the absence of any packet
queue, this would increase the used (processor) stack depth and potentially
introduce loops.
Currently I solved it implementing the following netif->output(), which seems
to work, but with heavy (processor) stack load.
err_t myif_output(struct netif* netif, struct pbuf* p, struct ip_addr* dest_ip)
{
if (ip_addr_cmp(dest_ip, &netif->ip_addr))
return netif->input(p, netif);
else
return etharp_output(netif, p, dest_ip);
}
- Is the above routine safe?
- Is there any safe and clean way to add this feature, possibly to lwip itself,
avoiding deep (processor) stack usage?
Thanks in advance,
Luca Ceresoli
- [lwip-users] Sending to myself,
Ceresoli Luca <=