|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64765 Some IPv6 addresses get interpreted wrong
Submitted: 2013-05-02 22:46 UTC Modified: 2013-09-13 05:45 UTC
From: gmcgraw at udel dot edu Assigned: lytboris
Status: No Feedback Package: SNMP related
PHP Version: 5.4.14 OS: Linux
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-05-02 22:46 UTC] gmcgraw at udel dot edu
PHP sends the following string to Net-SNMP to parse as an address:


Net-SNMP understands the final part of the IP address to be a port number, since 
it has no hexadecimal characters in it.  There was an earlier bug filed and 
fixed in PHP 5.4 that involved IPv6 but that fix only partially addressed the 
issue (bug #42918).  It made PHP correctly parse IPv6 address but it didn't 
ensure that PHP sent Net-SNMP a form of address that it will always correctly 

My patch causes square brackets to always surround the IPv6 address, so that 
Net-SNMP cannot possibly interpret the last part of the Ipv6 address as a port 
number.  The port number will be placed outside the square brackets.  Here is an 
example of how it will now send the IPV6 address to Net-SNMP:


Or if there is a custom port number 1234:


Net-SNMP will correctly parse that and use the default SNMP port number (161) if 
none is specified or the provided port number otherwise.

I have reproduced this in 5.4.1 and 5.4.14.

Test script:
$s=new SNMP(SNMP::VERSION_2C, '[fc00::23:250:56ff:fe82:3177]', 'public');

Expected result:
STRING: "Linux mykernel12345 #5 SMP Fri Jun 1 19:44:50 GMT 2012 x86_64"

Actual result:
Warning: SNMP::get(): No response from udp6:fc00::23:250:56ff:fe82:3177 in php 
shell code on line 1


snmp-ipv6-patch (last revision 2013-05-03 00:53 UTC) by gmcgraw at udel dot edu)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-05-03 08:41 UTC]
-Status: Open +Status: Closed
 [2013-05-03 08:41 UTC]
Automatic comment on behalf of lytboris
Log: Fix bug #64765 (enclose IPv6 address into square brackets)
 [2013-05-03 08:45 UTC]
Please try using this snapshot:
For Windows:

 [2013-05-03 08:45 UTC]
-Status: Closed +Status: Feedback
 [2013-05-03 11:16 UTC]
-Assigned To: +Assigned To: lytboris
 [2013-09-13 05:45 UTC]
-Status: Feedback +Status: No Feedback
 [2013-09-13 05:45 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.

PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 21:01:56 2014 UTC