lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] lwIP UDP and TFTP


From: Jani Monoses
Subject: Re: [lwip-devel] lwIP UDP and TFTP
Date: Wed, 26 Nov 2003 12:22:47 +0200

I think this January (see the CVS log for udp.c) I made some modifications
so to work around this problem - it seems that currently even in unixsim
you can't have to clients talking to the same udp server port in the same time.
But those changes were reverted because they introduces UPD_CONNECTED state 
which broke
some apps modifying the behaviour of the udp layer. I don;t remember the details
I know that Ed Sutter was the one who first raised this issue back than and 
IIRC.

> 
> > On Wed, 2003-11-26 at 09:25, Zschocke, Florian wrote:
> > > That is not completely correct. In the case of a connected UDP socket you
> > > will have to check the source port against the foreign port that the 
> > > socket
> > > is connected to. So the patch should instead read:
> > >
> > >  /* PCB remote port matches UDP source port for connected socket? */
> > >  if(((pcb->flags&UDP_FLAGS_CONNECTED)?(pcb->remote_port == src):1)&&
> > >    /* PCB local port matches UDP destination port? */
> > >    (pcb->local_port == dest) &&
> >
> > This doesn't solve the problem with TFTP as the socket is connected to
> > port 69 when sending the request. When the response arrives from the
> > server (from a different port) it gets rejected (the UDP_FLAGS_CONNECTED
> > is set and ports don't match).
> >
> > Furher thinking about the issue, the whole concept of a "connection" in
> > case of UDP is erroneous. As UDP is a connectionless protocol the stack
> > should _not_ be worried about where the packets come from. To repeat
> > myslef: Sending and receiving UDP packets are two totally different
> > operations; they shouldn't have anything to do with each other.
> 
> Having had a read through the relevant bit in TCP/IP Illustrated (Section
> 23.7 - udp_input) it would seem that the standard behaviour is to match
> against both port numbers (as lwIP currently does) *if* they are not
> wildcarded.  If the application has bound to both a local and destination
> port, then those should match.  If the application wants to receive from
> multiple remote ports, then it should leave the remote port wildcarded.
> Maybe lwIP is filling in this value when it shouldn't, but I don't think
> it's quite as simple as just never matching on the remote port.
> 
> The concept of a connection is valid in UDP.  Although it is a
> connectionless protocol (meaning there is no handshake before data are
> sent, or after all data have been received) that doesn't mean a UDP
> socket can't be connected to a particular pair of ip addresses & port
> numbers.  The problem is with English, where the word "connection" is
> overloaded and means many different things.
> 
> Kieran
> 
> 
> 
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/lwip-devel




reply via email to

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