diff --git a/SharpSnmpLib/Messaging/Messenger.cs b/SharpSnmpLib/Messaging/Messenger.cs index 18912916..9ba4ea93 100644 --- a/SharpSnmpLib/Messaging/Messenger.cs +++ b/SharpSnmpLib/Messaging/Messenger.cs @@ -217,6 +217,12 @@ public static async Task WalkAsync(VersionCode version, IPEndPoint endpoint do { seed = data.Item2; + + if (version == VersionCode.V2 && seed?.Data.TypeCode == SnmpType.EndOfMibView) + { + break; + } + if (seed == tableV) { data = await HasNextAsync(version, endpoint, community, seed).ConfigureAwait(false); @@ -703,6 +709,12 @@ public static int Walk(VersionCode version, IPEndPoint endpoint, OctetString com do { seed = next; + + if (version == VersionCode.V2 && seed?.Data.TypeCode == SnmpType.EndOfMibView) + { + break; + } + if (seed == tableV) { continue; diff --git a/SharpSnmpLib/Messaging/Net6Messenger.cs b/SharpSnmpLib/Messaging/Net6Messenger.cs index 30f21910..a62cf933 100644 --- a/SharpSnmpLib/Messaging/Net6Messenger.cs +++ b/SharpSnmpLib/Messaging/Net6Messenger.cs @@ -173,6 +173,12 @@ public static async Task WalkAsync(VersionCode version, IPEndPoint endpoint do { var seed = data.Item2; + + if (version == VersionCode.V2 && seed?.Data.TypeCode == SnmpType.EndOfMibView) + { + break; + } + if (seed == tableV) { data = await HasNextAsync(version, endpoint, community, seed, token).ConfigureAwait(false);