Blame SOURCES/kde-workspace-kdm_local_ipv6.patch

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