delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/02/06/09:20:41

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=D6W7I6nFTt2oPTfYIW8Q1ojmmCfntfrGW2zrpu/cRoIsdd5AkaFSH
MgsknTwV82EQsXSs0KgD1xOgqIhyQJwStCzcfjI1g3/v94yP31pqhVH1PmPdclx6
1O8i65kCxrlRYA2Y2Ezqk9H1H7uylBp1R+PFTSLFkPM2pUa5qoSZ8U=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=583e3soI2XYPHHfflQsYgzUo62Y=; b=xb4B6KyxzEm9VpQ/sT38oQrBvfos
qfaX4HGQJUqeHBtwBCnFb+Hbq74iD6zMuHRnOtkbdT7vmAJy8nkMdAhYqUcl9zFk
hy+3iICkAb27iBfxzMtgCGBSpuUBpiXw9TBhUp69PqeWt/w5S4nSuRpBHSgO+0Y+
JPjtAaxKL3yWDgg=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-101.9 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=systematic
X-HELO: drew.franken.de
Date: Tue, 6 Feb 2018 15:20:12 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: RPC clnt_create() adress already in use
Message-ID: <20180206142012.GB30794@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <59D90AF8D70E9740907BACDE2BCB520836E4AA63 AT RESW102 DOT resdom01 DOT local>
MIME-Version: 1.0
In-Reply-To: <59D90AF8D70E9740907BACDE2BCB520836E4AA63@RESW102.resdom01.local>
User-Agent: Mutt/1.9.1 (2017-09-22)

--UlVJffcvxoiEqYs2
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Feb  6 11:29, PAULUS, Raimund, TI-ABN wrote:
> On Feb  5 15:06, Corinna Vinschen wrote:
> > On Feb  5 14:34, Corinna Vinschen wrote:
> > > On Feb  5 12:26, Corinna Vinschen wrote:
> > > > [...]
> > > > What potential solutions to this problem do we have?
> > > >=20
> > > > - bindresvport could enforce SO_EXCLUSIVEADDRUSE temporarily to make
> > > >   sure bind fails.
> > >=20
> > > Nope, no way.  Even enforcing SO_EXCLUSIVEADDRUSE results in the=20
> > > second bind succeeding and the subsequent connect failing.  The=20
> > > entire SO_REUSEADDR/SO_EXCLUSIVEADDRUSE semantics only works as=20
> > > desired on the server side apparently
> > >=20
> > > > - bindresvport could check every local address for being free prior
> > > >   to calling bind.  However, there's a potential race here.
> > > >=20
> > > > - DisconnectEx?  Never tried this Winsock extension but it might be
> > > >   worth a shot.
> >=20
> > I think I have a very simple solution for the scenario which calls=20
> > bindresvport with port number.  Still looking for a solution for the=20
> > second problem...
>=20
> I've pushed a few patches and uploaded new developer snapshots to
> https://cygwin.com/snapshots.  Please give them a try.
>=20
> with the snapshot of cygwin1.dll and using bindresvport() from Cygwin
> for libtirpc (instead of the original bindresvport() from libtirpc)
> all my testcases work without error.
>=20
> Many thanks
> Raimund

Thanks for testing.  Please note that this should work most of the time,
but is still not 100% foolproof.  There's a systematic race between
checking existing connections and calling bind which can't be easily
worked around by Cygwin.  Still, should be better than before :}


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--UlVJffcvxoiEqYs2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlp5uZwACgkQ9TYGna5E
T6B++Q//b6gT1l7UcbNz/rswxwydEnD7egZetkKfF83Xn0toerCBiqeoqTnA1VPg
Dgoy8ug8fL2SEZ24Hc828eSst4dzLLg+MbW/8RrtXKERW5crnawqPOPCjb1RYCuD
jttWPr515Bgu0etHTFcTTwIeTSOjO7Cxejb6nZTmUA25utMzRJo3qQ3bYR2J5VEb
BSHTD60idzD5qcMMTZNdXz6FDcYRaQed+libWw5avxRApQ39lRsh7nhE6uDVOj9z
stsGSlbI68nl91gYHH8vQZzG5KB6Kvc6cLBEYQha+D81xr4KlF4RBi8Fb4hWE6Gh
MJgoyC3ARv3nvNCDHpA7sEuNLFxbwIRp7FJ6xARgPTWjk+1Kwa+4KsWPOzGDyElN
lBH0JKxbVi0p2+IDNgToD6Q8h/nOQXe7tZ45FlU+GbRilA+p9KUAXBiNHEQ/mnjU
3wNuhgLRqpG2AVfrGQm1BIhEGwZpX2+aKLH+civjlWa955Ym1ay4ux8mmntNh5ge
JmcwEh2BeoAhxERnTFJ6WQNySuPvRKWsOU59wMMLERAuY06JtqSpnyuNzCjENoU/
+OApeNecVwExR1BPa1qGJRfcHBaTdoPm4O6VTM51KSupth3402ifAFmyyNV5Sqks
Odap9vVV/e50erLWJqTRo6rIMvS3rVoedDOM5tCjnpfTzJK+p3A=
=Nzm5
-----END PGP SIGNATURE-----

--UlVJffcvxoiEqYs2--

- Raw text -


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