com php-src: Fix bug #64765 (enclose IPv6 address into square brackets): ext/snmp/snmp.c
| From: | Boris Lytochkin | Date: | Fri, 03 May 2013 08:13:50 +0000 |
| Subject: | com php-src: Fix bug #64765 (enclose IPv6 address into square brackets): ext/snmp/snmp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72097@lists.php.net to get a copy of this message | ||
Commit: 3828f6227b188bd0c8d829a375ebf51faf67c448
Author: Boris Lytochkin <lytboris@php.net> Fri, 3 May 2013 12:13:50 +0400
Parents: 5af2c5d20244a7cb3c9345ef4cf8c81997eb0984
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3828f6227b188bd0c8d829a375ebf51faf67c448
Log:
Fix bug #64765 (enclose IPv6 address into square brackets)
Bugs:
https://bugs.php.net/64765
Changed paths:
M ext/snmp/snmp.c
Diff:
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 0ae140f..fad5d05 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1162,9 +1162,10 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version,
char
continue;
}
if ((*res)->sa_family == AF_INET6) {
- strcpy(session->peername, "udp6:");
+ strcpy(session->peername, "udp6:[");
pptr = session->peername + strlen(session->peername);
inet_ntop((*res)->sa_family, &(((struct sockaddr_in6*)(*res))->sin6_addr), pptr,
MAX_NAME_LEN);
+ strcat(pptr, "]");
} else if ((*res)->sa_family == AF_INET) {
inet_ntop((*res)->sa_family, &(((struct sockaddr_in*)(*res))->sin_addr), pptr,
MAX_NAME_LEN);
} else {