Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
Fix defect #24
Browse files Browse the repository at this point in the history
GetSpecificMappingAsync under DD-WRT returns errorcode 402.
  • Loading branch information
lontivero committed Apr 21, 2015
1 parent 790b407 commit 4bad619
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Open.Nat/Upnp/UpnpNatDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,16 @@ public override async Task<Mapping> GetSpecificMappingAsync (Protocol protocol,
}
catch (MappingException e)
{
if (e.ErrorCode != UpnpConstants.NoSuchEntryInArray) throw;
return null;
if (e.ErrorCode == UpnpConstants.NoSuchEntryInArray ) return null;

// DD-WRT Linux base router (and others probably) fails with 402-InvalidArgument
// when no mapping is found in the mappings table
if (e.ErrorCode == UpnpConstants.InvalidArguments)
{
NatDiscoverer.TraceSource.LogWarn("Router failed with 402-InvalidArgument. Mapping not found is assumed.");
return null;
}
throw;
}
}

Expand Down

0 comments on commit 4bad619

Please sign in to comment.