Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,11 @@ static bool netsnmp_session_init(php_snmp_session **session_p, int version, zend
/* {{{ Set the security level in the snmpv3 session */
static bool netsnmp_session_set_sec_level(struct snmp_session *s, zend_string *level)
{
if (!s) {
zend_value_error("SNMP session is not initialized or has been closed");
return false;
}

if (zend_string_equals_literal_ci(level, "noAuthNoPriv") || zend_string_equals_literal_ci(level, "nanp")) {
s->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
} else if (zend_string_equals_literal_ci(level, "authNoPriv") || zend_string_equals_literal_ci(level, "anp")) {
Expand Down
Loading