[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Dest address gets corrupted
From: |
Rainer Salminen |
Subject: |
Re: [lwip-users] Dest address gets corrupted |
Date: |
Mon, 9 Nov 2009 11:35:24 +0200 |
I use udp_echo() from here:
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
<address@hidden>
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