X-Spam-Check-By: sourceware.org Date: Sun, 29 Jan 2006 13:31:40 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: SSH Local Port Forwarding Message-ID: <20060129123140.GK15572@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <242f7d730601261653h27c91a2bi660f3fc062aaeb7c AT mail DOT gmail DOT com> <20060127085608 DOT GF8318 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060127085608.GF8318@calimero.vinschen.de> User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 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/