Bug 2213 - X11 forwarding to DISPLAY containing a hexadecimal-colon IPv6 address fails
Summary: X11 forwarding to DISPLAY containing a hexadecimal-colon IPv6 address fails
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: Other Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-20 20:31 AEDT by jens Hektor
Modified: 2014-11-25 01:20 AEDT (History)
1 user (show)

See Also:


Attachments
Fixes Bug in client when $DISPLAY contains IPv6 address (516 bytes, patch)
2014-11-25 01:18 AEDT, jens Hektor
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jens Hektor 2014-03-20 20:31:46 AEDT
If an IPv6 host has no AAAA DNS entry the DISPLAY variable might
contain a hexadecimal/colon address.

The function x11_connect_display() in channels.c determins the "hostname"
in the DISPLAY variable by searching for the *first* colon occurence (line 3550 in that file):

    cp = strchr(buf, ':');

This seems to be incompatible with the representation of IPv6 addresses.

The resulting error produces an error message which can be attributed 
to the debug2 statement later in that function (line 3582):

    connect 2001 port 6006: Invalid argument
    Error: Can't open display: localhost:10.0

A workaround is documented here:

   http://www.technologische-hilfe.de/antworten/lightdm-xdm-sitzung-und-ipv6-support-241428392.html

My guess is that the problem can be solved by using strrchr in that statement:

     cp = strrchr(buf, ':');
Comment 1 jens Hektor 2014-03-21 18:41:07 AEDT
Forgot to mention the scenario:

we have XDMCP Clients with IPv6. If we use SSH from the XDMCP server X11 on remote hosts fails.
Comment 2 jens Hektor 2014-11-25 01:18:43 AEDT
Created attachment 2513 [details]
Fixes Bug in client when $DISPLAY contains IPv6 address
Comment 3 jens Hektor 2014-11-25 01:20:07 AEDT
The patch has been test here and is against openssh-6.7p1