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:from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=Qe0 kSc9fSTDa1K+WHkC1RUVW9hLE7AGx386gf8UvM+uNeFsZMwt68JbnOhR9/LTbokR 6O0fQVdkERqLF+zG0OZvFlf7fjNYiPoBmPYGPjxWVgpT9RDMaTzYBaQK36tQzxXQ 2ULb+H0ly+puzUucNloVX6/vCTfGx6cBknwxk/VU= 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:from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=F8q6Kw8XC qAMoZ/4tUDwN256gCw=; b=n52fmCjqXjGo0aBXxm8QvwkSZfPGAj6fyWGB38rFJ FZDNTI5bq2Z1Jf4gTARH8ZBrhnHyku2Q5/rvNEJI8vehzEevaf7P+G58F6No8yB9 tRtYvnFVN4Xue0QfOGvP9Ycpvqp47IHFJkht8VYqYPIt2Gd7tEymwk0hQOAqeDlj kg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-0.9 required=5.0 tests=AWL,BAYES_00,CYGWIN_OWNER_BODY,GIT_PATCH_2,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=H*MI:local, Win, systematic, H*F:D*biz X-HELO: mailrelay.dillinger.de From: "PAULUS, Raimund, TI-ABN" To: "'cygwin AT cygwin DOT com'" Subject: Re: RPC clnt_create() adress already in use Date: Tue, 27 Feb 2018 09:54:03 +0000 Message-ID: <59D90AF8D70E9740907BACDE2BCB520836F2555E@RESW102.resdom01.local> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w1R9sIjG027206 High Corinna, is it possible to get the patched cygwin1.dll for Cygwin 2.5.1? I have to support several older Win XP SP3 boxes. Raimund -----Ursprüngliche Nachricht----- Von: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] Im Auftrag von Corinna Vinschen Gesendet: Dienstag, 6. Februar 2018 15:20 An: cygwin AT cygwin DOT com Betreff: Re: RPC clnt_create() adress already in use 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? > > > > > > > > - bindresvport could enforce SO_EXCLUSIVEADDRUSE temporarily to make > > > > sure bind fails. > > > > > > Nope, no way. Even enforcing SO_EXCLUSIVEADDRUSE results in the > > > second bind succeeding and the subsequent connect failing. The > > > entire SO_REUSEADDR/SO_EXCLUSIVEADDRUSE semantics only works as > > > desired on the server side apparently > > > > > > > - bindresvport could check every local address for being free prior > > > > to calling bind. However, there's a potential race here. > > > > > > > > - DisconnectEx? Never tried this Winsock extension but it might be > > > > worth a shot. > > > > I think I have a very simple solution for the scenario which calls > > bindresvport with port number. Still looking for a solution for the > > second problem... > > I've pushed a few patches and uploaded new developer snapshots to > https://cygwin.com/snapshots. Please give them a try. > > 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. > > 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 -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple