diff options
Diffstat (limited to 'lang/php80/files')
-rw-r--r-- | lang/php80/files/patch-ext_standard_dns.c | 21 | ||||
-rw-r--r-- | lang/php80/files/patch-ext_standard_php__dns.h | 24 |
2 files changed, 45 insertions, 0 deletions
diff --git a/lang/php80/files/patch-ext_standard_dns.c b/lang/php80/files/patch-ext_standard_dns.c new file mode 100644 index 000000000000..58acda6824e1 --- /dev/null +++ b/lang/php80/files/patch-ext_standard_dns.c @@ -0,0 +1,21 @@ +--- ext/standard/dns.c.orig 2021-10-19 10:34:32 UTC ++++ ext/standard/dns.c +@@ -798,6 +798,7 @@ PHP_FUNCTION(dns_get_record) + zend_long type_param = PHP_DNS_ANY; + zval *authns = NULL, *addtl = NULL; + int type_to_fetch; ++ int dns_errno; + #if defined(HAVE_DNS_SEARCH) + struct sockaddr_storage from; + uint32_t fromsize = sizeof(from); +@@ -946,8 +947,9 @@ PHP_FUNCTION(dns_get_record) + n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer); + + if (n < 0) { ++ dns_errno = php_dns_errno(handle); + php_dns_free_handle(handle); +- switch (h_errno) { ++ switch (dns_errno) { + case NO_DATA: + case HOST_NOT_FOUND: + continue; diff --git a/lang/php80/files/patch-ext_standard_php__dns.h b/lang/php80/files/patch-ext_standard_php__dns.h new file mode 100644 index 000000000000..11ebd188624e --- /dev/null +++ b/lang/php80/files/patch-ext_standard_php__dns.h @@ -0,0 +1,24 @@ +--- ext/standard/php_dns.h.orig 2021-10-19 10:34:32 UTC ++++ ext/standard/php_dns.h +@@ -24,6 +24,7 @@ + ((int)dns_search(res, dname, class, type, (char *) answer, anslen, (struct sockaddr *)&from, &fromsize)) + #define php_dns_free_handle(res) \ + dns_free(res) ++#define php_dns_errno(handle) h_errno + + #elif defined(HAVE_RES_NSEARCH) + #define php_dns_search(res, dname, class, type, answer, anslen) \ +@@ -37,11 +38,13 @@ + res_nclose(res); \ + php_dns_free_res(res) + #endif ++#define php_dns_errno(handle) handle->res_h_errno + + #elif defined(HAVE_RES_SEARCH) + #define php_dns_search(res, dname, class, type, answer, anslen) \ + res_search(dname, class, type, answer, anslen) + #define php_dns_free_handle(res) /* noop */ ++#define php_dns_errno(handle) h_errno + + #endif + |