components/proftpd/patches/getipnodebyname.patch
author Sonam Gupta <sonam.x.gupta@oracle.com>
Fri, 17 May 2013 20:31:53 +0200
branchs11u1-sru
changeset 2625 5dad0fc5ed82
parent 902 908943bbfdb9
permissions -rw-r--r--
16362516 lpstat and lpq commands report bad value 16321334 lpstat -p always reports job id as '-0' 15731683 SUNBT7072114 cupsd: segfault in move_job+0x29d

--- a/src/netaddr.c
+++ b/src/netaddr.c
@@ -1295,12 +1295,19 @@ const char *pr_netaddr_get_dnsstr(pr_netaddr_t *na) {
     buf[sizeof(buf)-1] = '\0';
 
     if (res == 0) {
+      int err_num;
+      int flags;
       char **checkaddr;
       struct hostent *hent = NULL;
       unsigned char ok = FALSE;
       int family = pr_netaddr_get_family(na);
       void *inaddr = pr_netaddr_get_inaddr(na);
-    
+
+//#ifdef HAVE_GETIPNODEBYNAME
+#if 1
+      flags=AI_V4MAPPED;
+      hent=getipnodebyname(buf, family, flags, &err_num);
+#else
 #ifdef HAVE_GETHOSTBYNAME2
       if (pr_netaddr_is_v4mappedv6(na) == TRUE) {
         family = AF_INET;
@@ -1311,6 +1318,7 @@ const char *pr_netaddr_get_dnsstr(pr_netaddr_t *na) {
 #else
       hent = gethostbyname(buf);
 #endif /* HAVE_GETHOSTBYNAME2 */
+#endif /* HAVE_GETIPNODEBYNAME */
 
       if (hent != NULL) {