Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:eeich:BootPrj
xorg-x11
0001-XDM-Add-support-for-clients-that-sent-ipv4...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-XDM-Add-support-for-clients-that-sent-ipv4-addresses.patch of Package xorg-x11
From 115841a8615a5807e227ccfa07756a58dbe18059 Mon Sep 17 00:00:00 2001 From: Christoph Bartoschek <bartoschek@or.uni-bonn.de> Date: Sat, 28 Nov 2009 12:00:33 +0100 Subject: [PATCH] XDM: Add support for clients that sent ipv4 addresses to a dual-stacked host If a client sends an ipv4 address to a dual-stacked xdm that is bound to a ipv6 socket in a forward request, then the packet was silently discarded. Now the address is encapsulated as a ipv4-mapped address and a response is send back. --- xdmcp.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/xdmcp.c b/xdmcp.c index 7c91d1e..66a5e0f 100644 --- a/xdmcp.c +++ b/xdmcp.c @@ -791,8 +791,8 @@ forward_respond ( { struct sockaddr_in6 in6_addr; - if (clientAddress.length != 16 || - clientPort.length != 2) + if ((clientAddress.length != 16 && clientAddress.length != 4) || + (clientPort.length != 2)) { goto badAddress; } @@ -801,7 +801,24 @@ forward_respond ( in6_addr.sin6_len = sizeof(in6_addr); # endif in6_addr.sin6_family = AF_INET6; - memmove(&in6_addr.sin6_addr,clientAddress.data,clientAddress.length); + if (clientAddress.length == 16) { + memmove(in6_addr.sin6_addr.s6_addr, clientAddress.data, 16); + } else { + /* If the client wants to forward the xdm server to an + ipv4 hosts it sends an ipv4 address in the forward + packet. On dual-stack hosts the packet arrives as a + ipv6 packet. To respond to the ipv4 host one has + to create an ipv4-mapped address of the form + + ::ffff::xxx.xxx.xxx.xxx + + One example where this is necessary is an ipv4-only + thin client that connects to a dual-stacked xdm. + */ + in6_addr.sin6_addr.s6_addr[10] = 0xff; + in6_addr.sin6_addr.s6_addr[11] = 0xff; + memmove(in6_addr.sin6_addr.s6_addr + 12, clientAddress.data, 4); + } memmove((char *) &in6_addr.sin6_port, clientPort.data, 2); client = (struct sockaddr *) &in6_addr; clientlen = sizeof (in6_addr); -- 1.6.5.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor