[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] Sending to myself
From: |
Goldschmidt Simon |
Subject: |
RE: [lwip-users] Sending to myself |
Date: |
Wed, 9 Jan 2008 17:18:56 +0100 |
Hi,
The routine you created is already included in loopif.c (the loopback
interface). You only would have to make sure that packets sent to your own
external IP get sent over the loopback interface. The method to implement that
would be ip_route().
Simon
-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von Ceresoli Luca
Gesendet: Mittwoch, 9. Januar 2008 16:23
An: address@hidden
Betreff: [lwip-users] Sending to myself
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 mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users