From eb8651d4921adbc14eadcc961eb72669b750b16a Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 26 Jun 2025 11:46:43 -0400 Subject: [PATCH] IPv4: IP_HDRINCL may need a checksum. IP_HDRINCL isn't POSIX. The FreeBSD manual page for it doesn't specify, but the Linux manual page indicates it will compute the checksum. traceroute seems to depend on it doing so. Significantly improves the situation in #3210. --- src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp index 94e54f6c06..db0dd53f20 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp +++ b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp @@ -1546,8 +1546,9 @@ ipv4_send_routed_data(net_protocol* _protocol, struct net_route* route, header->source = source.sin_addr.s_addr; header->checksum = 0; header.Sync(); - } else + } else if (header->checksum != 0) { checksumNeeded = false; + } TRACE(" Header was already supplied:"); TRACE_ONLY(dump_ipv4_header(*header));