delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/29/19:14:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 29 Mar 2002 19:13:29 -0500
From: Christopher Faylor <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: sendto bug
Message-ID: <20020330001329.GA7168@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT GSO DOT 4 DOT 30L DOT 0203291509340 DOT 24339-100000 AT magic-pi-ball DOT mit DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.30L.0203291509340.24339-100000@magic-pi-ball.mit.edu>
User-Agent: Mutt/1.3.23.1i

On Fri, Mar 29, 2002 at 03:36:23PM -0500, David E Euresti wrote:
>
>Actually the Single UNIX Specification says:
>
>	If the socket is connectionless-mode, the message will be sent to
>	the address specified by dest_addr. If the socket is
>	connection-mode, dest_addr is ignored.
>
>And since sendto calls either WSASendTo or winsock 1 sendTo that state:
>
>	Even if the connectionless socket has been previously connected
>	using the connect function to a specific address, lpTo overrides
>	the destination address for that particular datagram only. On a
>	connection-oriented socket, the lpTo and iToLen parameters are
>	ignored; in this case, the WSASendTo is equivalent to WSASend.
>
>Therefore there should be no harm in passing in the NULL value to sendto.

I admit that I did miss that part (obviously) but I don't think that it
follows that dest_addr can always be NULL.  It looks like the value can
be NULL only if the socket is not connection-less.  Otherwise, it should
be checked for validity.

Also, if the argument is ignored then it apparently shouldn't be checked
at all, even to see if the non-NULL address is valid.

cgf
--
Please do not send me personal email with cygwin questions.
Use the resources at http://cygwin.com/ .

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019