]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #30995 (snmp extension does not build with net-snmp 5.2).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 7 Dec 2004 00:33:58 +0000 (00:33 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 7 Dec 2004 00:33:58 +0000 (00:33 +0000)
NEWS
ext/snmp/snmp.c

diff --git a/NEWS b/NEWS
index c62741ff86786c898acdc7c6736184d7347caeba..f3a6a4fc17843923de419e66ea7d29d30df04ccb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PHP                                                                        NEWS
 - Extended the functionality of is_subclass_of() to accept either a class name
   or an object as first parameter. (Andrey) 
 - Fixed potential problems with unserializing invalid serialize data. (Marcus)
+- Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). (Ilia)
 - Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). (Ilia)
 - Fixed bug #30967 (properties in extended mysqli classes don't work). (Georg)
 - Fixed bug #30922 (reflective functions crash PHP when interfaces extend
index 2100008a2e8fde8f378ca8b393e7ca94883a0616..475795665e8443d99012440dcff02421b9e6d498 100644 (file)
@@ -787,7 +787,21 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
                        s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
                        return (0);
 #ifdef HAVE_AES
-               } else if (!strcasecmp(prot, "AES128")) {
+               } else if (!strcasecmp(prot, "AES128")
+#ifdef SNMP_VALIDATE_ERR
+/* 
+* In Net-SNMP before 5.2, the following symbols exist:
+* usmAES128PrivProtocol, usmAES192PrivProtocol, usmAES256PrivProtocol
+* In an effort to be more standards-compliant, 5.2 removed the last two.
+* As of 5.2, the symbols are:
+* usmAESPrivProtocol, usmAES128PrivProtocol
+* 
+* As we want this extension to compile on both versions, we use the latter
+* symbol on purpose, as it's defined to be the same as the former.
+*/
+                       || !strcasecmp(prot, "AES")) {
+#else                  
+               ) {
                        s->securityPrivProto = usmAES128PrivProtocol;
                        s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol);
                        return (0);
@@ -799,6 +813,7 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
                        s->securityPrivProto = usmAES256PrivProtocol;
                        s->securityPrivProtoLen = OIDSIZE(usmAES256PrivProtocol);
                        return (0);
+#endif
 #endif
                } else if (strlen(prot)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid privacy protocol: %s", prot);