Blame SOURCES/kde-workspace-kdm_local_ipv6.patch

ff3475
--- ./kdm/backend/auth.c	2015-02-06 17:59:27.473734701 -0600
ff3475
+++ ./kdm/backend/auth.c.orig	2015-02-06 18:46:13.072441136 -0600
ff3475
@@ -44,6 +44,10 @@ 
ff3475
 
ff3475
 #include <sys/ioctl.h>
ff3475
 
ff3475
+#ifdef XDMCP
ff3475
+# include <string.h>
ff3475
+#endif
ff3475
+
ff3475
 #include "dm_socket.h"
ff3475
 #ifdef DNETCONN
ff3475
 # include <netdnet/dnetdb.h>
ff3475
@@ -1075,10 +1079,28 @@ 
ff3475
 static int
ff3475
 convertAuthAddr(char *saddr, int *len, CARD8 **addr)
ff3475
 {
ff3475
+    static const unsigned char ipv6_lo[] = {
ff3475
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
ff3475
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
ff3475
+    };
ff3475
+
ff3475
+    static const unsigned char ipv4_lo[] = {
ff3475
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
ff3475
+        0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01
ff3475
+    };
ff3475
+
ff3475
     int ret = convertAddr(saddr, len, addr);
ff3475
-    if (ret == FamilyInternet &&
ff3475
-            ((struct in_addr *)*addr)->s_addr == htonl(0x7F000001L))
ff3475
-        ret = FamilyLocal;
ff3475
+
ff3475
+    if (ret == FamilyInternet) {
ff3475
+        if (((struct in_addr *)*addr)->s_addr == htonl(0x7F000001L))
ff3475
+            ret = FamilyLocal;
ff3475
+    } else if (ret == FamilyInternet6) {
ff3475
+	if (memcmp(*addr, ipv6_lo, sizeof ipv6_lo) == 0)
ff3475
+            ret = FamilyLocal;
ff3475
+        else if (memcmp(*addr, ipv4_lo, sizeof ipv4_lo) == 0)
ff3475
+            ret = FamilyLocal;
ff3475
+    }
ff3475
+
ff3475
     return ret;
ff3475
 }
ff3475