slackware-current/source/n/libmilter/sendmail-8.15.2-gethostbyname2.patch
Patrick J Volkerding 5ff08990e9 Tue Sep 10 21:28:36 UTC 2019
a/glibc-solibs-2.30-x86_64-1.txz:  Upgraded.
a/kernel-firmware-20190909_6c6918a-noarch-1.txz:  Upgraded.
a/kernel-generic-4.19.72-x86_64-1.txz:  Upgraded.
a/kernel-huge-4.19.72-x86_64-1.txz:  Upgraded.
a/kernel-modules-4.19.72-x86_64-1.txz:  Upgraded.
d/kernel-headers-4.19.72-x86-1.txz:  Upgraded.
k/kernel-source-4.19.72-noarch-1.txz:  Upgraded.
l/gdk-pixbuf2-2.38.2-x86_64-1.txz:  Upgraded.
l/glibc-2.30-x86_64-1.txz:  Upgraded.
l/glibc-i18n-2.30-x86_64-1.txz:  Upgraded.
l/glibc-profile-2.30-x86_64-1.txz:  Upgraded.
n/libmilter-8.15.2-x86_64-3.txz:  Rebuilt.
  Use gethostbyname2() since RES_USE_INET6 is removed in glibc-2.30.
n/libqmi-1.22.6-x86_64-1.txz:  Upgraded.
n/postfix-3.4.6-x86_64-2.txz:  Rebuilt.
  Patched to fix removed macros in glibc-2.30.
n/yptools-2.14-x86_64-12.txz:  Rebuilt.
  Patched ypbind-mt for gettid() included in glibc-2.30.
xap/blackbox-0.75-x86_64-1.txz:  Upgraded.
isolinux/initrd.img:  Rebuilt.
kernels/*:  Upgraded.
usb-and-pxe-installers/usbboot.img:  Rebuilt.
2019-09-11 08:59:49 +02:00

39 lines
899 B
Diff

diff --git a/libmilter/sm_gethost.c b/libmilter/sm_gethost.c
index a025c8f..cd0ef31 100644
--- a/libmilter/sm_gethost.c
+++ b/libmilter/sm_gethost.c
@@ -49,8 +49,16 @@ sm_getipnodebyname(name, family, flags, err)
int flags;
int *err;
{
- bool resv6 = true;
struct hostent *h;
+# if HAS_GETHOSTBYNAME2
+
+ h = gethostbyname2(name, family);
+ if (h == NULL)
+ *err = h_errno;
+ return h;
+
+# else /* HAS_GETHOSTBYNAME2 */
+ bool resv6 = true;
if (family == AF_INET6)
{
@@ -60,7 +68,7 @@ sm_getipnodebyname(name, family, flags, err)
}
SM_SET_H_ERRNO(0);
h = gethostbyname(name);
- if (family == AF_INET6 && !resv6)
+ if (!resv6)
_res.options &= ~RES_USE_INET6;
/* the function is supposed to return only the requested family */
@@ -75,6 +83,7 @@ sm_getipnodebyname(name, family, flags, err)
else
*err = h_errno;
return h;
+# endif /* HAS_GETHOSTBYNAME2 */
}
void