php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73594 dns_get_record does not populate $additional out parameter
Submitted: 2016-11-23 19:47 UTC Modified: -
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: weirdan at gmail dot com Assigned:
Status: Closed Package: *Network Functions
PHP Version: 7.1.0RC6 OS: CentOS 7
Private report: No CVE-ID:
 [2016-11-23 19:47 UTC] 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


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-25 01:53 UTC] weirdan at gmail dot com
Fixed the bug, preparing tests and pull request. This bug affects PHP7.0.0+, but does not affect PHP5.6.*
 [2016-12-02 13:05 UTC] weirdan at gmail dot com
Is there anything else I can do to get this merged?
 [2016-12-18 19:55 UTC] ab@php.net
Automatic comment on behalf of weirdan@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c78fd4568e24b8c68062be0f98163b5f45213bae
Log: Fixed bug #73594
 [2016-12-18 19:55 UTC] ab@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Fri Jul 28 08:01:47 2017 UTC