Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/DevelopmentDPC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ name: Development DPC

on:
push:
branches: [ "Development" ]
branches-ignore:
- main
pull_request:
branches: [ "Development" ]
branches-ignore:
- main

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion DPCLibrary/Models/IPv4Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void LoadFromString(string address)
throw new ArgumentException("IPAddress must not be null");
}

if (!Validate.IPv4(address))
if (!Validate.IPv4Address(address))
{
throw new ArgumentException("IPAddress must be a valid IPv4 Address");
}
Expand Down
2 changes: 1 addition & 1 deletion DPCLibrary/Models/IPv6Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void LoadFromString(string address)
throw new ArgumentException("IPAddress must not be null");
}

if (!Validate.IPv6(address))
if (!Validate.IPv6Address(address))
{
throw new ArgumentException("IPAddress must be a valid IPv6 Address");
}
Expand Down
4 changes: 2 additions & 2 deletions DPCLibrary/Models/Route.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ public Route(XElement routeNode)
Prefix = Convert.ToInt32(routeNode.XPathSelectElement("PrefixSize")?.Value, CultureInfo.InvariantCulture);
}

if (Validate.IPv4(tempAddress))
if (Validate.IPv4Address(tempAddress))
{
Address = new IPv4Address();
Address.LoadFromString(tempAddress);
}
else if (Validate.IPv6(tempAddress))
else if (Validate.IPv6Address(tempAddress))
{
Address = new IPv6Address();
Address.LoadFromString(tempAddress);
Expand Down
6 changes: 3 additions & 3 deletions DPCLibrary/Utils/IPUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public static int GetIPCIDRSuffix(string address)
}

string[] splitAddress = address.Split('/');
if (splitAddress.Length == 1 && Validate.IPv4(address))
if (splitAddress.Length == 1 && Validate.IPv4EndpointAddress(address))
{
//If there is no CIDR then assume it is a single IPv4 hence /32
return 32;
}
if (splitAddress.Length == 1 && Validate.IPv6(address))
if (splitAddress.Length == 1 && Validate.IPv6EndpointAddress(address))
{
//If there is no CIDR then assume it is a single IPv6 hence /128
return 128;
}
else if (splitAddress.Length == 2)
{
if (Validate.IPv4(splitAddress[1]))
if (Validate.IPv4Address(splitAddress[1]))
{
//Mask may be in the format 255.255.0.0
return GetCIDRFromNetMask(splitAddress[1]);
Expand Down
4 changes: 2 additions & 2 deletions DPCLibrary/Utils/VPNProfileCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ private static List<string> GetOffice365ExcludeRoutes()
{
if (ipList.Contains(item)) continue;
//Don't add IPv6 addresses as currently windows won't connect the profile if a client doesn't have an IPv6 address and there are IPv6 routes in the Route Table
if (Validate.IPv4(item) || Validate.IPv4CIDR(item))
if (Validate.IPv4EndpointAddress(item) || Validate.IPv4CIDR(item))
{
ipList.Add(item);
}
Expand Down Expand Up @@ -1887,7 +1887,7 @@ private static string GetDNSRoutes(ref Dictionary<string, string> resolvedIPList
}
//Don't add IPv6 addresses as IPv6 Exclusions added to a machine without an IPv6 address breaks the tunnel completely
//if (Validate.IPv4(item) || Validate.IPv6(item))
if (Validate.IPv4(item.Key))
if (Validate.IPv4EndpointAddress(item.Key))
{
resolvedIPList.Add(item.Key, item.Value);
}
Expand Down
Loading
Loading