diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-04 22:03:47 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-04 22:03:47 +0000 |
commit | 450fda6015f1799648ff7da87fdb2c46d42415f8 (patch) | |
tree | 1bb668d77159d2d607d96d08102fd247fb084f7c /access.c | |
parent | ca56bbdb0d398371332467534deaefdb77883bd7 (diff) |
XFree86 4.3.99.901 (RC 1)xf86-4_3_99_901
Diffstat (limited to 'access.c')
-rw-r--r-- | access.c | 39 |
1 files changed, 35 insertions, 4 deletions
@@ -27,7 +27,7 @@ in this Software without prior written authorization from the copyright holder. * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/xdm/access.c,v 3.12 2003/07/18 15:53:28 tsi Exp $ */ +/* $XFree86: xc/programs/xdm/access.c,v 3.14 2003/11/23 22:02:07 herrb Exp $ */ /* * Access control for XDMCP - keep a database of allowable display addresses @@ -49,6 +49,10 @@ in this Software without prior written authorization from the copyright holder. # include <netdb.h> +# if defined(IPv6) && defined(AF_INET6) +# include <arpa/inet.h> +# endif + #define ALIAS_CHARACTER '%' #define NEGATE_CHARACTER '!' #define CHOOSER_STRING "CHOOSER" @@ -330,7 +334,7 @@ tryagain: } #else if (hostent) { - addr = &(hostent->h_addr); + addr = hostent->h_addr; addr_length = hostent->h_length; } #endif @@ -440,9 +444,10 @@ ReadDisplayEntry (FILE *file) #else struct hostent *hostent; - if ((hostent = gethostbyname (displayOrAlias)) == NULL) + if ((hostent = gethostbyname (displayOrAlias)) != NULL) { - addr = &(hostent->h_addr); + Debug("ReadDisplayEntry: %s\n", displayOrAlias); + addr = hostent->h_addr; addrtype = hostent->h_addrtype; addr_length = hostent->h_length; } @@ -906,6 +911,32 @@ void ForEachListenAddr ( } if (!listenFound) { (*listenfunction) (NULL, closure); +#if defined(IPv6) && defined(AF_INET6) && defined(XDM_DEFAULT_MCAST_ADDR6) + { /* Join default IPv6 Multicast Group */ + + static ARRAY8 defaultMcastAddress; + + if (defaultMcastAddress.length == 0) { + struct in6_addr addr6; + + if (inet_pton(AF_INET6,XDM_DEFAULT_MCAST_ADDR6,&addr6) == 1) { + if (!XdmcpAllocARRAY8 (&defaultMcastAddress, + sizeof(struct in6_addr))) { + LogOutOfMem ("ReadHostEntry\n"); + defaultMcastAddress.length = -1; + } else { + memcpy(defaultMcastAddress.data, &addr6, + sizeof(struct in6_addr)); + } + } else { + defaultMcastAddress.length = -1; + } + } + if ( defaultMcastAddress.length == sizeof(struct in6_addr) ) { + (*mcastfunction) (&defaultMcastAddress, closure); + } + } +#endif } } |