RPC clnt_create() adress already in use
Corinna Vinschen
corinna-cygwin@cygwin.com
Tue Feb 6 14:20:00 GMT 2018
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20180206/7e52272e/attachment.sig>
More information about the Cygwin
mailing list