This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SSH Local Port Forwarding


On Jan 27 09:56, Corinna Vinschen wrote:
> On Jan 26 16:53, Jon Dixon wrote:
> >    I have Cygwin version 1.5.18-1 installed on a Windows 2003 Server
> > System.  My question is in regard to the SSH Local Port Forwarding
> > feature.  I activate the ssh local port forwarding with the command
> > line statement:
> > 
> >    ssh ?L2001:server.com:23 server.com.
> > 
> > At this point, an application can connect to Cygwin listening on port
> > 2001.   However if another program is executed and also listens on
> > port 2001, it too will run.  Is there an option available where by SSH
> > can open up the Local Port Forwarding listening port in exclusive mode
> > (i.e. SO_EXCLUSIVEADDRUSE) so no other programs can simultaneously
> > listen on the same port?
> 
> Unfortunately not.  WinSock behaves somewhat different than one would
> expect in terms of port reuse.  I will look into this issue at some
> later point, as time permits, and see if SO_EXCLUSIVEADDRUSE could help
> here.

I have checked in a patch which sets the SO_EXCLUSIVEADDRUSE option when
bind is called and the application hasn't explicitely set the socket to
SO_REUSEADDR before.  This seems to emulate POSIX behaviour now more
closely in terms of local address reuse.

Keep in mind that the SO_EXCLUSIVEADDRUSE option is only supported since
NT4 SP4, and that under Windows 2000 up to SP3 and under XP up to SP1
only local admins can successfully use this option due to a bug in
WinSock (see Microsoft's KB article 870562).

Please test the next developer's snapshot from http://cygwin.com/snapshots/


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]