Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道如果我们在函数libnet_build_tcp中写入0,tcp校验和会自动计算,那么为什么我们需要libnet_do_checksum呢?
当我尝试构建新数据包时出现错误。一个规则的 TCP 数据包(SYN,ACK)工作正常,但一个 HTTP 数据包不起作用,因为 tcp 校验和错误。我必须使用 libnet_do_checksum 吗?
当您想手动计算校验和时,您可以使用 libnet_do_checksum(),例如,您可以在发送之前对其进行检查。
您确定携带 HTTP 数据的数据包有校验和错误吗?操作系统可能正在使用校验和卸载。Wireshark 会在原始机器上报告错误的校验和,但网卡会在通过网络发送数据包之前计算它。