lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Re: Issue with udp_input() and source ports


From: address@hidden
Subject: Re: [lwip-users] Re: Issue with udp_input() and source ports
Date: Mon, 10 Aug 2009 15:18:17 +0200
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

I must say I agree to what Jakobs says. I thought the functions sendto()/recvfrom() were meant exactly for situations like this.

Simon


Jakob Stoklund Olesen wrote:
Kieran Mansley <address@hidden> writes:

On Thu, 2009-08-06 at 15:36 -0700, Brian Lam wrote:
I looked into udp.c and saw that udp_input() checks both the source and
destination port of connected pcbs before it considers it a match(line
195, rev 1.109). I think that this may be in violation of RFC 768 which
states that:

"Source Port is an optional field, when meaningful, it indicates the port
of the sending  process,  and may be assumed  to be the port  to which a
reply should  be addressed  in the absence of any other information.  If
not used, a value of zero is inserted."
Could you file a bug for this on savannah?

On the other hand, from Linux "man 2 connect":

  If the socket sockfd is of type SOCK_DGRAM then addr is the address to
  which datagrams are sent by default, and the only address from which
  datagrams are received.  If the socket is of type SOCK_STREAM or
  SOCK_SEQ‐ PACKET, this call attempts to make a connection to the
  socket that is bound to the address specified by addr.

If you want to receive UDP from anybody, don't call connect().

/jakob



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






reply via email to

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