Bug 71407

Summary: Using an ipv6 address with the -from option fails
Product: xorg Reporter: Ed <ed>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
adding support for ipv6 "from" address
none
Improved version of the patch none

Description Ed 2013-11-08 23:04:13 UTC
When using an ipv6 address as the -from argument, you get the following error:
Xserver: failed to bind to -from address: 2001:980:8d99:1:63::9

When stracing the code i see:

socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 6
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 7
setsockopt(7, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
bind(7, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "2001:980:8d88:1:63::9", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EAFNOSUPPORT (Address family not supported by protocol)

socket "7" is opened with PF_INET, and bind is using AF_INET6 and fails.

alan on irc #xorg-devel wrote: I think the problem is at http://cgit.freedesktop.org/xorg/xserver/tree/os/xdmcp.c#n992  where the bind is always done to xdmcpSocket instead of checking address type to use xdmcpSocket6

Good luck with fixing this bug!

Kind regards,
Ed
Comment 1 Ed 2013-11-09 10:37:34 UTC
Created attachment 88923 [details] [review]
adding support for ipv6 "from" address

I wrote the attached patch and it seem to work.
( tested with X.Org X Server 1.14.3 )
Comment 2 Ed 2013-11-10 11:46:30 UTC
Created attachment 88971 [details] [review]
Improved version of the patch

adds support for an ipv6 address as a "from" argument
Comment 3 Alan Coopersmith 2018-10-18 22:33:01 UTC
Also reported as https://gitlab.freedesktop.org/xorg/xserver/issues/4
Comment 4 GitLab Migration User 2018-12-13 22:29:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/450.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.