From 1d177f6aba4c6ce0be2dd3ca2b20681e3b55d4a3 Mon Sep 17 00:00:00 2001
From: xljiulang <366193849@qq.com>
Date: Mon, 17 Oct 2022 20:25:54 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8CalcOutboundFlag?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
FastGithub.PacketIntercept/Dns/DnsInterceptor.cs | 11 ++---------
.../FastGithub.PacketIntercept.csproj | 2 +-
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs b/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
index 0e47414..ce7c3b6 100644
--- a/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
+++ b/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs
@@ -149,16 +149,9 @@ namespace FastGithub.PacketIntercept.Dns
result.UdpHeader->Length = (ushort)(sizeof(UdpHeader) + responsePayload.Length);
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);
+
this.logger.LogInformation($"{domain}->{loopback}");
}
diff --git a/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj b/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj
index 890c1ee..3b01562 100644
--- a/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj
+++ b/FastGithub.PacketIntercept/FastGithub.PacketIntercept.csproj
@@ -7,7 +7,7 @@
-
+