浏览代码

修复dns服务为回环ip时的问题

老九 3 年之前
父节点
当前提交
b4623ddb60
共有 1 个文件被更改,包括 0 次插入10 次删除
  1. 0 10
      FastGithub.PacketIntercept/Dns/DnsInterceptor.cs

+ 0 - 10
FastGithub.PacketIntercept/Dns/DnsInterceptor.cs

@@ -163,17 +163,7 @@ namespace FastGithub.PacketIntercept.Dns
             packet.UdpHeader->SrcPort = destPort;
             packet.UdpHeader->Length = BinaryPrimitives.ReverseEndianness((ushort)(sizeof(UdpHeader) + responsePayload.Length));
 
-            // 反转方向
             winDivertAddress.Impostor = true;
-            if (winDivertAddress.Direction == WinDivertDirection.Inbound)
-            {
-                winDivertAddress.Direction = WinDivertDirection.Outbound;
-            }
-            else
-            {
-                winDivertAddress.Direction = WinDivertDirection.Inbound;
-            }
-
             WinDivert.WinDivertHelperCalcChecksums(winDivertBuffer, packetLength, ref winDivertAddress, WinDivertChecksumHelperParam.All);
             this.logger.LogInformation($"{domain} => {IPAddress.Loopback}");
         }