Skip to content

Commit c4dfca9

Browse files
authored
Merge pull request #196 from luke-waymark-addinsight/master
Add EndOfMibView Check to Walk functions
2 parents 3840a4f + b188748 commit c4dfca9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

SharpSnmpLib/Messaging/Messenger.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ public static async Task<int> WalkAsync(VersionCode version, IPEndPoint endpoint
217217
do
218218
{
219219
seed = data.Item2;
220+
221+
if (version == VersionCode.V2 && seed?.Data.TypeCode == SnmpType.EndOfMibView)
222+
{
223+
break;
224+
}
225+
220226
if (seed == tableV)
221227
{
222228
data = await HasNextAsync(version, endpoint, community, seed).ConfigureAwait(false);
@@ -703,6 +709,12 @@ public static int Walk(VersionCode version, IPEndPoint endpoint, OctetString com
703709
do
704710
{
705711
seed = next;
712+
713+
if (version == VersionCode.V2 && seed?.Data.TypeCode == SnmpType.EndOfMibView)
714+
{
715+
break;
716+
}
717+
706718
if (seed == tableV)
707719
{
708720
continue;

SharpSnmpLib/Messaging/Net6Messenger.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ public static async Task<int> WalkAsync(VersionCode version, IPEndPoint endpoint
173173
do
174174
{
175175
var seed = data.Item2;
176+
177+
if (version == VersionCode.V2 && seed?.Data.TypeCode == SnmpType.EndOfMibView)
178+
{
179+
break;
180+
}
181+
176182
if (seed == tableV)
177183
{
178184
data = await HasNextAsync(version, endpoint, community, seed, token).ConfigureAwait(false);

0 commit comments

Comments
 (0)