소스 검색

使用CalcOutboundFlag

xljiulang 2 년 전
부모
커밋
1d177f6aba
2개의 변경된 파일3개의 추가작업 그리고 10개의 파일을 삭제
  1. 2 9
      FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
  2. 1 1
      FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj

+ 2 - 9
FastGithub.PacketIntercept/Dns/DnsInterceptor.cs

@@ -149,16 +149,9 @@ namespace FastGithub.PacketIntercept.Dns
             result.UdpHeader->Length = (ushort)(sizeof(UdpHeader) + responsePayload.Length);
             result.UdpHeader->Length = (ushort)(sizeof(UdpHeader) + responsePayload.Length);
 
 
             addr.Flags |= WinDivertAddressFlag.Impostor;
             addr.Flags |= WinDivertAddressFlag.Impostor;
-            if (addr.Flags.HasFlag(WinDivertAddressFlag.Loopback))
-            {
-                addr.Flags |= WinDivertAddressFlag.Outbound;
-            }
-            else
-            {
-                addr.Flags &= ~WinDivertAddressFlag.Outbound;
-            }
-
+            packet.CalcOutboundFlag(addr);
             packet.CalcChecksums(addr);
             packet.CalcChecksums(addr);
+
             this.logger.LogInformation($"{domain}->{loopback}");
             this.logger.LogInformation($"{domain}->{loopback}");
         }
         }
 
 

+ 1 - 1
FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj

@@ -7,7 +7,7 @@
 	<ItemGroup>
 	<ItemGroup>
 		<FrameworkReference Include="Microsoft.AspNetCore.App" />
 		<FrameworkReference Include="Microsoft.AspNetCore.App" />
 		<PackageReference Include="DNS" Version="7.0.0" />
 		<PackageReference Include="DNS" Version="7.0.0" />
-		<PackageReference Include="WindivertDotnet" Version="1.0.4" />
+		<PackageReference Include="WindivertDotnet" Version="1.0.5" />
 	</ItemGroup>
 	</ItemGroup>
 
 
 	<ItemGroup>
 	<ItemGroup>