aboutsummaryrefslogtreecommitdiff
path: root/Mono.Nat/Pmp/PmpSearcher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Mono.Nat/Pmp/PmpSearcher.cs')
-rw-r--r--Mono.Nat/Pmp/PmpSearcher.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Mono.Nat/Pmp/PmpSearcher.cs b/Mono.Nat/Pmp/PmpSearcher.cs
index 5e4155841..46c2e9d80 100644
--- a/Mono.Nat/Pmp/PmpSearcher.cs
+++ b/Mono.Nat/Pmp/PmpSearcher.cs
@@ -81,12 +81,12 @@ namespace Mono.Nat
try
{
- foreach (NetworkInterface n in NetworkInterface.GetAllNetworkInterfaces())
+ foreach (var n in NetworkInterface.GetAllNetworkInterfaces())
{
if (n.OperationalStatus != OperationalStatus.Up && n.OperationalStatus != OperationalStatus.Unknown)
continue;
IPInterfaceProperties properties = n.GetIPProperties();
- List<IPEndPoint> gatewayList = new List<IPEndPoint>();
+ var gatewayList = new List<IPEndPoint>();
foreach (GatewayIPAddressInformation gateway in properties.GatewayAddresses)
{
@@ -105,7 +105,7 @@ namespace Mono.Nat
gatewayList.Add(new IPEndPoint(gw2, PmpConstants.ServerPort));
}
}
- foreach (var unicast in properties.UnicastAddresses)
+ foreach (UnicastIPAddressInformation unicast in properties.UnicastAddresses)
{
if (/*unicast.DuplicateAddressDetectionState == DuplicateAddressDetectionState.Preferred
&& unicast.AddressPreferredLifetime != UInt32.MaxValue
@@ -120,7 +120,7 @@ namespace Mono.Nat
if (gatewayList.Count > 0)
{
- foreach (UnicastIPAddressInformation address in properties.UnicastAddresses)
+ foreach (var address in properties.UnicastAddresses)
{
if (address.Address.AddressFamily == AddressFamily.InterNetwork)
{
@@ -189,8 +189,8 @@ namespace Mono.Nat
bool IsSearchAddress(IPAddress address)
{
- foreach (List<IPEndPoint> gatewayList in gatewayLists.Values)
- foreach (IPEndPoint gatewayEndpoint in gatewayList)
+ foreach (var gatewayList in gatewayLists.Values)
+ foreach (var gatewayEndpoint in gatewayList)
if (gatewayEndpoint.Address.Equals(address))
return true;
return false;
@@ -210,7 +210,7 @@ namespace Mono.Nat
if (errorcode != 0)
_logger.LogDebug("Non zero error: {0}", errorcode);
- IPAddress publicIp = new IPAddress(new byte[] { response[8], response[9], response[10], response[11] });
+ var publicIp = new IPAddress(new byte[] { response[8], response[9], response[10], response[11] });
nextSearch = DateTime.Now.AddMinutes(5);
timeout = 250;