浏览代码

修复ipv6包的Length计算的bug

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

+ 1 - 1
FastGithub.PacketIntercept/Dns/DnsInterceptor.cs

@@ -165,7 +165,7 @@ namespace FastGithub.PacketIntercept.Dns
                 destAddress = packet.IPv6Header->DstAddr;
                 packet.IPv6Header->DstAddr = packet.IPv6Header->SrcAddr;
                 packet.IPv6Header->SrcAddr = destAddress;
-                packet.IPv6Header->Length = (ushort)packetLength;
+                packet.IPv6Header->Length = (ushort)(packetLength - sizeof(IPv6Header));
             }
 
             // 修改udp包