[Xcb] Re: [Xcb-commit] Fix IP6 work for FreeBSD/Mac.
Jamey Sharp
jamey at minilop.net
Tue Nov 21 15:53:38 PST 2006
Hi Ian!
Could you explain what's wacky about the MacOS X implementation of
IN6_IS_ADDR_V4MAPPED and IN6_IS_ADDR_LOOPBACK that required this patch?
Thanks,
--Jamey
p.s. http://solair.livejournal.com/9404.html
On Tue, Nov 21, 2006 at 09:04:48AM -0800, Ian Osgood wrote:
> +#define SIN6_ADDR(s) (&((struct sockaddr_in6 *)s)->sin6_addr)
> +
> static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen,
> int display)
> {
> @@ -92,11 +94,11 @@ static Xauth *get_authptr(struct sockadd
> switch(sockname->sa_family)
> {
> case AF_INET6:
> - addr = (char *) &((struct sockaddr_in6 *)sockname)->sin6_addr;
> - addrlen = sizeof(((struct sockaddr_in6 *)sockname)->sin6_addr);
> - if(!IN6_IS_ADDR_V4MAPPED(addr))
> + addr = (char *) SIN6_ADDR(sockname);
> + addrlen = sizeof(*SIN6_ADDR(sockname));
> + if(!IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname)))
> {
> - if(!IN6_IS_ADDR_LOOPBACK(addr))
> + if(!IN6_IS_ADDR_LOOPBACK(SIN6_ADDR(sockname)))
> family = XCB_FAMILY_INTERNET_6;
> break;
> }
> @@ -180,7 +182,7 @@ static int compute_auth(xcb_auth_info_t
> case AF_INET6:
> /*block*/ {
> struct sockaddr_in6 *si6 = (struct sockaddr_in6 *) sockname;
> - if(IN6_IS_ADDR_V4MAPPED(si6->sin6_addr.s6_addr))
> + if(IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname)))
> {
> APPEND(info->data, j, si6->sin6_addr.s6_addr[12]);
> APPEND(info->data, j, si6->sin6_port);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061121/a0348ee2/attachment.pgp
More information about the Xcb
mailing list