|
From: SourceForge.net <no...@so...> - 2012-09-17 12:49:54
|
Patches item #3564180, was opened at 2012-09-02 10:03 Message generated for change (Comment added) made by tanders You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3564180&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Finzel Stefan (fis04268) Assigned to: Nobody/Anonymous (nobody) Summary: writing to oid with invalid type does not fail (correctly) Initial Comment: net-snmp-5-7-2-rc2: - IP-MIB::ipForwarding is Integer32 but writable as Counter32, Unsigned32, TimeTicks. - IP-MIB::ipForwarding is Interger32, but writing with as IpAddress will not return error wrongType but wrongValue. - ipAddressSpinLock is Interger32, but writing as Counter32, Unsigned32, TimeTick, IpAddress will not return error wrongType but inconsistentValue snmpset -v2c -cprivate 192.168.0.39 1.3.6.1.2.1.4.1.0 u 1 iso.3.6.1.2.1.4.1.0 = Gauge32: 1 snmpset -v2c -cprivate 192.168.0.39 1.3.6.1.2.1.4.1.0 a 1 Error in packet. Reason: wrongValue (The set value is illegal or unsupported in some way) Failed object: iso.3.6.1.2.1.4.1.0 snmpset -v2c -cprivate 192.168.0.39 1.3.6.1.2.1.4.33.0 u 1 Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: iso.3.6.1.2.1.4.33.0 ERROR set 1.3.6.1.2.1.4.1.0 Integer32 is writable as Counter32 ERROR set 1.3.6.1.2.1.4.1.0 Integer32 is writable as Unsigned32 ERROR set 1.3.6.1.2.1.4.1.0 Integer32 is writable as TimeTicks ERROR set 1.3.6.1.2.1.4.1.0 Integer32 as IpAddress returns wrongValue 0 {1.3.6.1.2.1.4.1.0 IpAddress 0.0.0.0} ERROR set 1.3.6.1.2.1.4.33.0 Integer32 as Counter32 returns inconsistentValue 0 {1.3.6.1.2.1.4.33.0 Counter32 1} ERROR set 1.3.6.1.2.1.4.33.0 Integer32 as Unsigned32 returns inconsistentValue 0 {1.3.6.1.2.1.4.33.0 Unsigned32 1} ERROR set 1.3.6.1.2.1.4.33.0 Integer32 as TimeTicks returns inconsistentValue 0 {1.3.6.1.2.1.4.33.0 TimeTicks 1} ERROR set 1.3.6.1.2.1.4.33.0 Integer32 as IpAddress returns inconsistentValue 0 {1.3.6.1.2.1.4.33.0 IpAddress 0.0.0.0} ---------------------------------------------------------------------- >Comment By: Thomas Anders (tanders) Date: 2012-09-17 05:49 Message: moving to patches ---------------------------------------------------------------------- Comment By: Finzel Stefan (fis04268) Date: 2012-09-17 05:14 Message: fiexed by --- net-snmp-5.7.2.rc2/agent/mibgroup/ip-mib/ip_scalars.c 2012-09-01 19:20:47.000000000 +0200 +++ net-snmp-5.7.2.rc2/agent/mibgroup/ip-mib/ip_scalars.c.new 2012-09-17 14:01:27.657974001 +0200 @@ -133,7 +133,10 @@ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg */ case MODE_SET_RESERVE1: - break; + if (requests->requestvb->type != ASN_INTEGER) { + (void) netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGTYPE); + } + break; case MODE_SET_RESERVE2: /* @@ -237,7 +240,10 @@ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg */ case MODE_SET_RESERVE1: - break; + if (requests->requestvb->type != ASN_INTEGER) { + (void) netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGTYPE); + } + break; case MODE_SET_RESERVE2: /* @@ -332,6 +338,10 @@ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg */ case MODE_SET_RESERVE1: + if (requests->requestvb->type != ASN_INTEGER) { + (void) netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGTYPE); + } + break; case MODE_SET_RESERVE2: /* just check the value */ value = *(requests->requestvb->val.integer); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3564180&group_id=12694 |