components/proftpd/patches/getipnodebyname.patch
author Tomas Klacko <tomas.klacko@oracle.com>
Mon, 02 Jul 2012 11:16:01 -0700
changeset 902 908943bbfdb9
permissions -rw-r--r--
7087284 proftpd using GSS fails for IPv6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
902
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     1
--- a/src/netaddr.c
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     2
+++ b/src/netaddr.c
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     3
@@ -1295,12 +1295,19 @@ const char *pr_netaddr_get_dnsstr(pr_netaddr_t *na) {
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     4
     buf[sizeof(buf)-1] = '\0';
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     5
 
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     6
     if (res == 0) {
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     7
+      int err_num;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     8
+      int flags;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     9
       char **checkaddr;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    10
       struct hostent *hent = NULL;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    11
       unsigned char ok = FALSE;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    12
       int family = pr_netaddr_get_family(na);
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    13
       void *inaddr = pr_netaddr_get_inaddr(na);
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    14
-    
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    15
+
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    16
+//#ifdef HAVE_GETIPNODEBYNAME
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    17
+#if 1
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    18
+      flags=AI_V4MAPPED;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    19
+      hent=getipnodebyname(buf, family, flags, &err_num);
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    20
+#else
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    21
 #ifdef HAVE_GETHOSTBYNAME2
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    22
       if (pr_netaddr_is_v4mappedv6(na) == TRUE) {
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    23
         family = AF_INET;
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    24
@@ -1311,6 +1318,7 @@ const char *pr_netaddr_get_dnsstr(pr_netaddr_t *na) {
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    25
 #else
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    26
       hent = gethostbyname(buf);
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    27
 #endif /* HAVE_GETHOSTBYNAME2 */
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    28
+#endif /* HAVE_GETIPNODEBYNAME */
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    29
 
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    30
       if (hent != NULL) {
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    31
 
908943bbfdb9 7087284 proftpd using GSS fails for IPv6
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    32