[PATCH:xdm 2/4] Remove unused DECnet ("DNETCONN") code from xdm

Alan Coopersmith alan.coopersmith at oracle.com
Wed Dec 26 21:56:08 PST 2012


Has never been converted to build in modular builds, so has been unusable
since X11R7.0 release in 2005.  DNETCONN support was removed from xtrans
back in 2008.

Mostly performed via "unifdef -UDNETCONN" followed by imdent,
and then manual cleanup.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xdm/auth.c    |   82 +++++++++++++++++++++------------------------------------
 xdm/netaddr.c |   13 ---------
 xdm/policy.c  |    3 ---
 xdm/xdmcp.c   |   21 +--------------
 4 files changed, 31 insertions(+), 88 deletions(-)

diff --git a/xdm/auth.c b/xdm/auth.c
index 9ec21ac..cd5084c 100644
--- a/xdm/auth.c
+++ b/xdm/auth.c
@@ -51,10 +51,6 @@ from The Open Group.
 #ifdef TCPCONN
 # include "dm_socket.h"
 #endif
-#ifdef DNETCONN
-# include <netdnet/dn.h>
-# include <netdnet/dnetdb.h>
-#endif
 
 #if defined(hpux)
 # include <sys/utsname.h>
@@ -1080,56 +1076,43 @@ DefineSelf (int fd, FILE *file, Xauth *auth)
     for (cp = (char *) IFC_IFC_REQ; cp < cplim; cp += ifr_size (ifr))
     {
 	ifr = (ifr_type *) cp;
-#   ifdef DNETCONN
+	family = ConvertAddr ((XdmcpNetaddr) &IFR_IFR_ADDR, &len, &addr);
+	if (family < 0)
+	    continue;
+
+	if (len == 0)
+	{
+	    Debug ("Skipping zero length address\n");
+	    continue;
+	}
 	/*
-	 * this is ugly but SIOCGIFCONF returns decnet addresses in
-	 * a different form from other decnet calls
+	 * don't write out 'localhost' entries, as
+	 * they may conflict with other local entries.
+	 * DefineLocal will always be called to add
+	 * the local entry anyway, so this one can
+	 * be tossed.
 	 */
-	if (IFR_IFR_ADDR.sa_family == AF_DECnet) {
-		len = sizeof (struct dn_naddr);
-		addr = (char *)ifr->ifr_addr.sa_data;
-		family = FamilyDECnet;
-	} else
-#   endif
+	if (family == FamilyInternet && len == 4 &&
+	    addr[0] == 127 && addr[1] == 0 &&
+	    addr[2] == 0 && addr[3] == 1)
 	{
-	    family = ConvertAddr ((XdmcpNetaddr) &IFR_IFR_ADDR, &len, &addr);
-	    if (family < 0)
-		continue;
-
-	    if (len == 0)
-	    {
-		Debug ("Skipping zero length address\n");
+	    Debug ("Skipping localhost address\n");
+	    continue;
+	}
+#   if defined(IPv6) && defined(AF_INET6)
+	if (family == FamilyInternet6) {
+	    if (IN6_IS_ADDR_LOOPBACK(((struct in6_addr *)addr))) {
+		Debug ("Skipping IPv6 localhost address\n");
 		continue;
 	    }
-	    /*
-	     * don't write out 'localhost' entries, as
-	     * they may conflict with other local entries.
-	     * DefineLocal will always be called to add
-	     * the local entry anyway, so this one can
-	     * be tossed.
-	     */
-	    if (family == FamilyInternet && len == 4 &&
-		addr[0] == 127 && addr[1] == 0 &&
-		addr[2] == 0 && addr[3] == 1)
-	    {
-		    Debug ("Skipping localhost address\n");
-		    continue;
-	    }
-#   if defined(IPv6) && defined(AF_INET6)
-	    if(family == FamilyInternet6) {
-		if (IN6_IS_ADDR_LOOPBACK(((struct in6_addr *)addr))) {
-		    Debug ("Skipping IPv6 localhost address\n");
-		    continue;
-		}
-		/* Also skip XDM-AUTHORIZATION-1 */
-		if (auth->name_length == 19 &&
-		    strcmp(auth->name, "XDM-AUTHORIZATION-1") == 0) {
-		    Debug ("Skipping IPv6 XDM-AUTHORIZATION-1\n");
-		    continue;
-		}
+	    /* Also skip XDM-AUTHORIZATION-1 */
+	    if (auth->name_length == 19 &&
+		strcmp(auth->name, "XDM-AUTHORIZATION-1") == 0) {
+		Debug ("Skipping IPv6 XDM-AUTHORIZATION-1\n");
+		continue;
 	    }
-#   endif
 	}
+#   endif
 	Debug ("DefineSelf: write network address, length %d\n", len);
 	writeAddr (family, len, addr, file, auth);
     }
@@ -1227,11 +1210,6 @@ writeLocalAuth (FILE *file, Xauth *auth, char *name)
     DefineSelf (fd, file, auth);
     close (fd);
 #endif
-#ifdef DNETCONN
-    fd = socket (AF_DECnet, SOCK_STREAM, 0);
-    DefineSelf (fd, file, auth);
-    close (fd);
-#endif
     DefineLocal (file, auth);
 }
 
diff --git a/xdm/netaddr.c b/xdm/netaddr.c
index d42e9b7..72b12e0 100644
--- a/xdm/netaddr.c
+++ b/xdm/netaddr.c
@@ -46,9 +46,6 @@ from The Open Group.
 #   include <sys/un.h>		/* struct sockaddr_un */
 #  endif
 # endif
-# ifdef DNETCONN
-#  include <netdnet/dn.h>		/* struct sockaddr_dn */
-# endif
 
 /* given an XdmcpNetaddr, returns the socket protocol family used,
    e.g., AF_INET */
@@ -111,11 +108,6 @@ char * NetaddrAddress(XdmcpNetaddr netaddrp, int *lenp)
     }
 #  endif
 # endif
-# ifdef DNETCONN
-    case AF_DECnet:
-        *lenp = sizeof (struct dn_naddr);
-        return (char *) &(((struct sockaddr_dn *)netaddrp)->sdn_add);
-# endif
 # ifdef AF_CHAOS
     case AF_CHAOS:
 # endif
@@ -164,11 +156,6 @@ int ConvertAddr (XdmcpNetaddr saddr, int *len, char **addr)
 	break;
 #  endif
 # endif
-# ifdef DNETCONN
-      case AF_DECnet:
-        retval = FamilyDECnet;
-	break;
-# endif
 # ifdef AF_CHAOS
     case AF_CHAOS:
 	retval = FamilyChaos;
diff --git a/xdm/policy.c b/xdm/policy.c
index 835fccf..fb1e7de 100644
--- a/xdm/policy.c
+++ b/xdm/policy.c
@@ -196,9 +196,6 @@ SelectConnectionTypeIndex (
 	  case FamilyInternet6:
 #  endif /* IPv6 */
 # endif /* TCPCONN */
-# if defined(DNETCONN)
-	  case FamilyDECnet:
-# endif /* DNETCONN */
 	    return i;
 	}
     } /* for */
diff --git a/xdm/xdmcp.c b/xdm/xdmcp.c
index 051d501..3c0c55c 100644
--- a/xdm/xdmcp.c
+++ b/xdm/xdmcp.c
@@ -695,10 +695,6 @@ NetworkAddressToName(
 	    return name;
 	}
 # endif /* IPv6 */
-# ifdef DNET
-    case FamilyDECnet:
-	return NULL;
-# endif /* DNET */
     default:
 	return NULL;
     }
@@ -1478,10 +1474,6 @@ NetworkAddressToHostname (
 	    name = strdup (local_name);
 	    break;
 	}
-# ifdef DNET
-    case FamilyDECnet:
-	break;
-# endif /* DNET */
     default:
 	break;
     }
@@ -1509,10 +1501,6 @@ ARRAY8Ptr   connectionAddress)
 	    memmove( connectionAddress->data, hostent->h_addr, hostent->h_length);
 	    return TRUE;
 	}
-#  ifdef DNET
-    case FamilyDECnet:
-	return FALSE;
-#  endif
     }
     return FALSE;
 }
@@ -1553,10 +1541,8 @@ CARD16Ptr   displayNumber)
 	dnet = TRUE;
 	colon++;
     }
-#  ifndef DNETCONN
     if (dnet)
 	return FALSE;
-#  endif
     display_number = colon + 1;
     while (*display_number && *display_number != '.')
     {
@@ -1566,12 +1552,7 @@ CARD16Ptr   displayNumber)
     if (display_number == colon + 1)
 	return FALSE;
     number = atoi (colon + 1);
-#  ifdef DNETCONN
-    if (dnet)
-	connectionType = FamilyDECnet;
-    else
-#  endif
-	connectionType = FamilyInternet;
+    connectionType = FamilyInternet;
     if (!HostnameToNetworkAddress (hostname, connectionType, connectionAddress))
 	return FALSE;
     *displayNumber = number;
-- 
1.7.9.2



More information about the xorg-devel mailing list