From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45213 invoked by alias); 6 Feb 2018 14:20:30 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 45204 invoked by uid 89); 6 Feb 2018 14:20:29 -0000 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 Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Feb 2018 14:20:21 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id DB8BF721E281E for ; Tue, 6 Feb 2018 15:20:12 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 8B5515E03C9 for ; Tue, 6 Feb 2018 15:20:12 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id 75422A8066D; Tue, 6 Feb 2018 15:20:12 +0100 (CET) Date: Tue, 06 Feb 2018 14:20:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: RPC clnt_create() adress already in use Message-ID: <20180206142012.GB30794@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <59D90AF8D70E9740907BACDE2BCB520836E4AA63@RESW102.resdom01.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <59D90AF8D70E9740907BACDE2BCB520836E4AA63@RESW102.resdom01.local> User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2018-02/txt/msg00060.txt.bz2 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1867 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" Content-length: 833 -----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--