summaryrefslogtreecommitdiff
path: root/chooser.c
diff options
context:
space:
mode:
Diffstat (limited to 'chooser.c')
-rw-r--r--chooser.c71
1 files changed, 2 insertions, 69 deletions
diff --git a/chooser.c b/chooser.c
index 4d47a12..e0d1821 100644
--- a/chooser.c
+++ b/chooser.c
@@ -26,7 +26,7 @@ in this Software without prior written authorization from The Open Group.
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/xdm/chooser.c,v 3.26 2003/07/18 15:53:28 tsi Exp $ */
+/* $XFree86: xc/programs/xdm/chooser.c,v 3.27 2003/11/23 22:57:31 herrb Exp $ */
/*
* Chooser - display a menu of names and let the user select one
@@ -130,9 +130,7 @@ in this Software without prior written authorization from The Open Group.
# include <sync/queue.h>
# include <sync/sema.h>
#endif
-#ifndef __GNU__
-# include <net/if.h>
-#endif /* __GNU__ */
+#include <net/if.h>
#endif /* hpux */
#include <netdb.h>
@@ -573,8 +571,6 @@ RegisterHostaddr (struct sockaddr *addr, int len, xdmOpCode type)
* addresses on the local host.
*/
-#if !defined(__GNU__)
-
/* Handle variable length ifreq in BNR2 and later */
#ifdef VARIABLE_IFREQ
#define ifr_size(p) (sizeof (struct ifreq) + \
@@ -768,69 +764,6 @@ RegisterHostname (char *name)
#endif /* IPv6 */
}
}
-#else /* __GNU__ */
-static void
-RegisterHostname (char *name)
-{
- struct hostent *hostent;
- struct sockaddr_in in_addr;
-
- if (!strcmp (name, BROADCAST_HOSTNAME))
- {
- in_addr.sin_addr.s_addr= htonl(0xFFFFFFFF);
- in_addr.sin_port = htons (XDM_UDP_PORT);
- RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
- BROADCAST_QUERY);
- }
- else
- {
-
- /* address as hex string, e.g., "12180022" (deprecated) */
- if (strlen(name) == 8 &&
- FromHex(name, (char *)&in_addr.sin_addr, strlen(name)) == 0)
- {
- in_addr.sin_family = AF_INET;
- in_addr.sin_port = htons (XDM_UDP_PORT);
- RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
- QUERY);
- } else {
-#if defined(IPv6) && defined(AF_INET6)
- char sport[8];
- struct addrinfo *ai, *nai, hints;
- bzero(&hints,sizeof(hints));
- hints.ai_socktype = SOCK_DGRAM;
- sprintf(sport, "%d", XDM_UDP_PORT);
- if (getaddrinfo(name, sport, &hints, &ai) == 0) {
- for (nai = ai ; nai != NULL ; nai = nai->ai_next) {
- if ((nai->ai_family == AF_INET) ||
- (nai->ai_family == AF_INET6)) {
- RegisterHostaddr(nai->ai_addr, nai->ai_addrlen, QUERY);
- }
- }
- }
-#else
- /* Per RFC 1123, check first for IP address in dotted-decimal form */
- else if ((in_addr.sin_addr.s_addr = inet_addr(name)) != -1)
- in_addr.sin_family = AF_INET;
- else
- {
- hostent = gethostbyname (name);
- if (!hostent)
- return;
- if (hostent->h_addrtype != AF_INET || hostent->h_length != 4)
- return;
- in_addr.sin_family = hostent->h_addrtype;
- memmove( &in_addr.sin_addr, hostent->h_addr, 4);
- }
- in_addr.sin_port = htons (XDM_UDP_PORT);
- RegisterHostaddr ((struct sockaddr *)&in_addr, sizeof (in_addr),
- QUERY);
-#endif
- }
-
- }
-}
-#endif /* __GNU__ */
static ARRAYofARRAY8 AuthenticationNames;