iliaa           Mon Dec  6 19:33:25 2004 EDT

  Modified files:              
    /php-src/ext/snmp   snmp.c 
  Log:
  Fixed bug #30995 (snmp extension does not build with net-snmp 5.2).
  
  
http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.93&r2=1.94&ty=u
Index: php-src/ext/snmp/snmp.c
diff -u php-src/ext/snmp/snmp.c:1.93 php-src/ext/snmp/snmp.c:1.94
--- php-src/ext/snmp/snmp.c:1.93        Mon Sep 27 10:19:07 2004
+++ php-src/ext/snmp/snmp.c     Mon Dec  6 19:33:24 2004
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: snmp.c,v 1.93 2004/09/27 14:19:07 hyanantha Exp $ */
+/* $Id: snmp.c,v 1.94 2004/12/07 00:33:24 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -781,7 +781,21 @@
                        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);
@@ -794,6 +808,7 @@
                        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);
                }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to