Bug #73594 [Com]: dns_get_record does not populate $additional out parameter
| From: | weirdan at gmail dot com | Date: | Fri, 25 Nov 2016 01:53:47 +0000 |
| Subject: | Bug #73594 [Com]: dns_get_record does not populate $additional out parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205626@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73594&edit=1
ID: 73594
Comment by: weirdan at gmail dot com
Reported by: weirdan at gmail dot com
Summary: dns_get_record does not populate $additional out
parameter
Status: Open
Type: Bug
Package: *Network Functions
Operating System: CentOS 7
PHP Version: 7.1.0RC6
Block user comment: N
Private report: N
New Comment:
Fixed the bug, preparing tests and pull request. This bug affects PHP7.0.0+, but does not affect
PHP5.6.*
Previous Comments:
------------------------------------------------------------------------
[2016-11-23 19:47:31] weirdan at gmail dot com
Description:
------------
After upgrading from PHP 5.6.27 to 7.1.0RC6 dns_get_record stopped returning additional records in
its out parameter. I've confirmed with tcpdump that PHP (libresolv I imagine) sends the same
request as before, and gets the same answer (with additional records), yet $additional array in the
following code is no longer populated.
Test script:
---------------
The actual code I'm trying to get working is:
<?php
$auth = [];
$additional = [];
var_dump(dns_get_record("_mysql._slave.service.consul", DNS_SRV, $auth, $additional),
$auth, $additional);
?>
However it depends on consul service discovery.
Simpler reproduce script would be:
<?php
$auth = [];
$additional = [];
var_dump(count(dns_get_record("php.net", DNS_ANY, $auth, $additional)), count($auth),
count($additional));
?>
Yet it requires known DNS server that returns additional records to be configured as your preferred
recursor in /etc/resolv.conf (I used PHP.net's authoritative DNS server below):
nameserver 162.159.24.53
Expected result:
----------------
With php.net script above, with resolv.conf configured as described there, running on PHP 5.6.27 I
get:
int(9)
int(0)
int(8) <--- $additional is NOT empty
Actual result:
--------------
Running on PHP 7.1.RC6 (otherwise configured the same) I get:
int(9)
int(0)
int(0) <--- $additional IS empty
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73594&edit=1