lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
356 stars 152 forks source link

BulkHasNext bug #448

Closed lextudio-support closed 5 hours ago

lextudio-support commented 5 hours ago

Hi! I'd like to ask you about BulkWalk and BulkHasNext methods in Lextm.SharpSnmpLib.Messaging.Messenger class. In the BulkWalk method you use the incoming OID from which the Get Bulk operation (in BulkHasNext method) starts to request N variables (N = maxRepetitions). On the next iteration of "while" procedure you use the identification of the latest variable got on the previous iteration. But in this case the last variable of previous iteration results and the first variable of current iteration results are the same and will be added to the list twice. For example if we run GetBulk operation twice, first time starting with .1.3.6.1.2.1.2.2.1.1 OID and run 5 repetitions once, we have the values of:

  1. .1.3.6.1.2.1.2.2.1.1
  2. .1.3.6.1.2.1.2.2.1.2
  3. .1.3.6.1.2.1.2.2.1.3
  4. .1.3.6.1.2.1.2.2.1.4
  5. .1.3.6.1.2.1.2.2.1.5 // !!!
  6. .1.3.6.1.2.1.2.2.1.5 // !!! once again!
  7. .1.3.6.1.2.1.2.2.1.6
  8. .1.3.6.1.2.1.2.2.1.7
  9. .1.3.6.1.2.1.2.2.1.8
  10. .1.3.6.1.2.1.2.2.1.9

// And we have lost the .1.3.6.1.2.1.2.2.1.10 OID!

Is it the bug of BulkHasNext method? I think that you should perform BulkHasNext method starting with another (probably, next) variable than the last of previous results list. Another problem related with this bug is infinite looping. It's occurs if we have only one exit-condition - empty result of GetResponse operation.

AlexML

Original Reported Date: 2010-04-27T00:12:14.963-07:00 Original CodePlex Discussion Thread ID: 210653

lextudio-support commented 5 hours ago

Copied from CodePlex without authors:

Hi AlexML,

I cannot say it is #SNMP bug. Why it cannot be an agent bug?

SNMP Agent (snmpd.exe), and snmp4j TestAgent both works fine against our

snmpbulkget.exe test cases. So I suspect the SNMP agent you use does not handle GET BULK messages correctly.

Regards,

Lex

Original Posted Date: 2010-04-27T04:05:54.34-07:00

lextudio-support commented 5 hours ago

Marked as Answer Date: 2013-10-06T21:44:18.457-07:00