Bug 1787 - -g flag has issues with ipv6 (Address already in use)
Summary: -g flag has issues with ipv6 (Address already in use)
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 5.3p1
Hardware: amd64 Linux
: P2 trivial
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-22 23:35 AEST by Hatem Nassrat
Modified: 2010-10-12 14:27 AEDT (History)
1 user (show)

See Also:


Attachments
v6only.diff (1.06 KB, patch)
2010-06-23 06:18 AEST, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hatem Nassrat 2010-06-22 23:35:17 AEST
Using the -g flag, gives an error, e.g.:

hnassrat@HNASSRAT-LNX1 ~> ssh -vgL 9000:localhost:9000 hatem@nassrat
[...]
debug1: Local connections to *:9000 forwarded to remote address localhost:9000
debug1: Local forwarding listening on 0.0.0.0 port 9000.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on :: port 9000.
bind: Address already in use

I am not sure if this issue is specific to linux and thus a bug in linux network config, but when it bound to 0.0.0.0 it listens to all interfaces then trying to listen to the ipv6 interface causes it to say bind address already in use. In this case (OpenSSH_5.3p1 Debian-3ubuntu3, OpenSSL 0.9.8k 25 Mar 2009) the error is useless, however with a machine running OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 it binds to ipv6 first.

In any case the workaround I used, thanks to ssh being awesome and having cool features, is to use the command as follows:

hnassrat@HNASSRAT-LNX1 ~> ssh -4gL 9000:localhost:9000 hatem@nassrat

This maybe another side-effect, but although I specified only listen on ipv4, i would think it will probably listen on all interfaces (thats probably not an ssh bug though).
Comment 1 Damien Miller 2010-06-23 06:18:02 AEST
Created attachment 1883 [details]
v6only.diff

Please try this patch.
Comment 2 Damien Miller 2010-10-12 14:27:56 AEDT
ping - have you had a chance to try the patch I supplied?