Skip to content

Commit

Permalink
Merge pull request #196 from luke-waymark-addinsight/master
Browse files Browse the repository at this point in the history
Add EndOfMibView Check to Walk functions
  • Loading branch information
lextm authored Oct 19, 2024
2 parents 3840a4f + b188748 commit c4dfca9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions SharpSnmpLib/Messaging/Messenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ public static async Task<int> 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);
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions SharpSnmpLib/Messaging/Net6Messenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ public static async Task<int> 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);
Expand Down

0 comments on commit c4dfca9

Please sign in to comment.