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 <kie...@recoil.org> 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
lwip-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users




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

Reply via email to