summaryrefslogtreecommitdiff
path: root/src/xcb_auth.c
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2006-11-21 00:57:49 -0800
committerJosh Triplett <josh@freedesktop.org>2006-11-21 00:57:49 -0800
commit684b8271a4539527daa15da82ad0cc302fb44727 (patch)
treecfa00911a87f95bad127bbde57c5c7e7b506ef20 /src/xcb_auth.c
parentd6abe93b06c421b78e92d76ceb5ca181e3adff31 (diff)
Support XDM-AUTHORIZATION-1 on IPv6
Commit by Jamey Sharp and Josh Triplett.
Diffstat (limited to 'src/xcb_auth.c')
-rw-r--r--src/xcb_auth.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index a4745bc..afab318 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -177,6 +177,26 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr *
APPEND(info->data, j, si->sin_port);
}
break;
+ case AF_INET6:
+ /*block*/ {
+ struct sockaddr_in6 *si6 = (struct sockaddr_in6 *) sockname;
+ if(IN6_IS_ADDR_V4MAPPED(si6->sin6_addr.s6_addr))
+ {
+ APPEND(info->data, j, si6->sin6_addr.s6_addr[12]);
+ APPEND(info->data, j, si6->sin6_port);
+ }
+ else
+ {
+ /* XDM-AUTHORIZATION-1 does not handle IPv6 correctly. Do the
+ same thing Xlib does: use all zeroes for the 4-byte address
+ and 2-byte port number. */
+ long fakeaddr = 0;
+ short fakeport = 0;
+ APPEND(info->data, j, fakeaddr);
+ APPEND(info->data, j, fakeport);
+ }
+ }
+ break;
case AF_UNIX:
/*block*/ {
long fakeaddr = htonl(0xffffffff - next_nonce());