PuTTY semi-bug portfwd-multi

Home | Licence | FAQ | Docs | Download | Keys | Links
Mirrors | Updates | Feedback | Changes | Wishlist | Team

summary: Port forwarding should cope better with already-used ports
class: semi-bug: This might or might not be a bug, depending on your precise definition of what a bug is.
difficulty: mayhem: Probably impossible
priority: medium: This should be fixed one day.

When attempting to open a forwarded port that's already bound (e.g. running multiple sessions with the same port forwarding settings), PuTTY should warn that it was unable to open the port (perhaps a line in the Event Log). (Currently it just acts as though both instances successfully opened the port.)

Worryingly, this doesn't look like a PuTTY problem; it seems that Windows is happy to let the second PuTTY process open the port for listening, and report success, and never thinks to tell it that the port is already in use by the first PuTTY. Running the Windows 2000 `netstat' utility even lists the same port twice.

Therefore, there's probably nothing we can do about this.

Update: It's been suggested that it could be down to the setsockopt(SO_REUSEADDR) in winnet.c:sk_newlistener(). (Not verified.) Could we remove this, or even use SO_EXCLUSIVEADDRUSE? (Although this isn't available on 95/98/Me.)
More info: OF46EEC8F3.5421D245-ON85256D7A.00644BCA-85256D7A.00669819@tisny.com

Audit trail for this semi-bug.


If you want to comment on this web site, see the Feedback page.
(last revision of this bug record was at 2004-11-16 15:27:00 +0000)