This commit is contained in:
snltty
2024-10-17 17:30:30 +08:00
parent c5a12185e7
commit 078d61d5b0
36 changed files with 769 additions and 150 deletions

View File

@@ -79,11 +79,11 @@ namespace linker.plugins.tunnel
{
if (c.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
uint ip = BinaryPrimitives.ReadUInt32BigEndian(c.GetAddressBytes());
uint ip = NetworkHelper.IP2Value(c);
foreach (var item in excludeips)
{
uint maskValue = NetworkHelper.GetPrefixIP(item.Mask);
uint ip1 = BinaryPrimitives.ReadUInt32BigEndian(item.IPAddress.GetAddressBytes());
uint maskValue = NetworkHelper.PrefixLength2Value(item.Mask);
uint ip1 = NetworkHelper.IP2Value(item.IPAddress);
if ((ip & maskValue) == (ip1 & maskValue))
{
return false;