I use udp_echo() from here:

http://cvs.savannah.gnu.org/viewvc/contrib/ports/unix/proj/unixsim/apps/udpecho.c?revision=1.4&root=lwip&view=markup

I have tested this using WIN32/MSC9 port and with my ARM7 -based "toy"
system.

What happens in ip_output_if_opt() is that

- pbuf *p points to incoming message
- dest points to (correctly) to original source address in p (, which will
be  a new destination)
- ip header addresses are swapped:
   -- ip_addr_set(&(iphdr->dest), dest) makes iphdr->dest to point to
original source
   -- ip_addr_set(&(iphdr->src), src) makes iphdr->src to point our own ip
- but dest has not changed and it points still to the same address, where
original source was but which now contains a new src address (our own ip)

Fix is to set

dest = &(iphdr->dest);


Rainer


2009/11/6 Kieran Mansley <[email protected]>

> On Thu, 2009-11-05 at 20:39 +0200, Rainer Salminen wrote:
> > If incoming packet contains IP header, then outgoing packet has source
> > address as destination address causing either use of loopback
> > interface or a failed ARP request.
>
> Can you explain a bit more about how you reproduce this problem?  Are
> you perhaps referring to an ICMP request, or is it more general than
> that?
>
> Kieran
>
>
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to