Bug #73594 [NEW]: dns_get_record does not populate $additional out parameter
| From: | weirdan at gmail dot com | Date: | Wed, 23 Nov 2016 19:47:33 +0000 |
| Subject: | Bug #73594 [NEW]: dns_get_record does not populate $additional out parameter | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205582@lists.php.net to get a copy of this message | ||
From: weirdan at gmail dot com
Operating system: CentOS 7
PHP version: 7.1.0RC6
Package: *Network Functions
Bug Type: Bug
Bug description:dns_get_record does not populate $additional out parameter
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 bug report at https://bugs.php.net/bug.php?id=73594&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73594&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73594&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73594&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73594&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73594&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73594&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73594&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73594&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73594&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73594&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73594&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73594&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73594&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73594&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73594&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73594&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73594&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73594&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73594&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73594&r=mysqlcfg