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

This commit is contained in:
老九 2021-09-24 22:21:07 +08:00
parent 23c2e4f40f
commit b4623ddb60

View File

@ -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}");
}