[Top][All Lists]

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

Re: [lwip-users] Data passed to UDP receive callback

From: Kieran Mansley
Subject: Re: [lwip-users] Data passed to UDP receive callback
Date: Mon, 10 Aug 2009 11:33:59 +0100

On Sun, 2009-08-09 at 16:13 -0400, Ben Hastings wrote:
> It looks like the source address of the received packet is changed on
> line 591 of ip.c, when it sets the source address of the outgoing
> packet:
>   ip_addr_set(&(iphdr->src), src);
> Is this correct behavior?  Shouldn't the source address of a received
> packet be valid for the length of the callback, no matter what I do with
> the pbuf?

It looks like you're trying to send the pbuf that you've just received,
and that the problem arises because the address you've been given points
to the received header that then is changed by the sendto operation.  Is
that correct?

If that's the case, then I think your fix of copying the address out of
the received pbuf is the right thing to do.  The only alternative would
be for lwIP to do this operation all the time, when usually it would not
be necessary.


reply via email to

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