From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H25TjwFK; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 68A9C5A0639 for ; Fri, 14 Feb 2025 23:57:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739573842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AHwJb+6awTPgq34e52WhUNOgOnOUvZVk/MGCDs/MwTA=; b=H25TjwFK34nIQeTiBdhcn17CNcyR55ltwdpFU/cjm0VpYzL/KhAerZ/P4GtFnJ2usal9So HzYeJfCPYp7aBz4usPzzlXNoD7J8bESJizz2ziq4KR3njG71bPnc4VZcxO5Q4polhosX8t th5pq668Q/lPOLE2GZmdM8kI8wG2mGk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-106-p0UgkDgFMYCiZn2_BdcLIg-1; Fri, 14 Feb 2025 17:57:21 -0500 X-MC-Unique: p0UgkDgFMYCiZn2_BdcLIg-1 X-Mimecast-MFC-AGG-ID: p0UgkDgFMYCiZn2_BdcLIg_1739573840 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4395f1c4366so14122315e9.3 for ; Fri, 14 Feb 2025 14:57:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739573840; x=1740178640; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AHwJb+6awTPgq34e52WhUNOgOnOUvZVk/MGCDs/MwTA=; b=CRdXJaiOINhN3hUE6G12uwek2anjMeO11950xydOR/Aag5w4XMR33jBz65LJv+AlSa 5l7bVvk5YaQxBYgl6/LhxPzLDrYg5vFPM383qpteM2khcoRtY8rZyCPluIof/c8IKwqo SzQvI9kfVtbn2PO1ow6PFLjgAubMX2AiGahtLJfsdiwUw6NlZ3VweyUgJMPAGXaQ0GGe HmUQRq0dJAwURuiYbtegGcVXZne846Qk86xKovksRaulCZee4lVEEhzCCf+i7aqi+ZwF ZaE8n46IvoIwFiFHPmd/VLHPLMYMx67AFhYBAK/l9aPVT6r5hED59Vvu5+5DXqnYDIfc YfLA== X-Gm-Message-State: AOJu0YxI96fXM5x45LIGkbngT/rzit3jnwGxwiW6ItTILJprMZssHiX1 Dw1GkyDhHVnUQctZKPBZzfI+005d4QfrGmohaZ5LlbP8plK/8/LDymVESEF8SfsDxgm4I8xfLQ2 AvBL3qyD47qwnkMkFrazknBPdn26VwgjcoqV7Jr75QpoSmm7OgPK0G2a2gJD+oTkXW+HIB1oTRa zzz8hxzsUZ/fefzT7eOpckP4F0GXT1E2kv X-Gm-Gg: ASbGncsjXQy+r7EVUc6tgDzFx30VLw8IJ1VEf9L1Eo8b9tt3bDZW06wyr06fDYXWq0E rs1iRvoW5IwvvE987ItKXlVROO89nO50iiwoXT+/jMuWFRVmmZniX7NSTdc7zPALzf6pfz3WWi8 KvvGyQ/UXs8qdSDM1S0hNXTqzKnJ03ylouqJ1Sh6bnGhW8HJmcUPS8h8AnG7LxAtIL7D1carVou uzFub+JuizHrfen6nxtqW1bi4jTygtKDDjzI/wwfEVlo8h0XQEFA9kvuXkdrwXfLAh8eQZfptYz nRrye7Vk0jC45qqz X-Received: by 2002:a05:600c:3c9c:b0:434:fb65:ebbb with SMTP id 5b1f17b1804b1-4396e6fae27mr13236995e9.17.1739573839724; Fri, 14 Feb 2025 14:57:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IG21fhz5fO6tc/tgl+L9Bbb+f0Kv4/tGHC0UBiGJtClPQEO7mLmQxBSsf1+qBfogMOopd8VKA== X-Received: by 2002:a05:600c:3c9c:b0:434:fb65:ebbb with SMTP id 5b1f17b1804b1-4396e6fae27mr13236765e9.17.1739573839235; Fri, 14 Feb 2025 14:57:19 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a1b84bcsm90150645e9.40.2025.02.14.14.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 14:57:18 -0800 (PST) Date: Fri, 14 Feb 2025 23:57:16 +0100 From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH] tap: always set the no_frag flag in IPv4 headers. Message-ID: <20250214235716.2c7019df@elisabeth> In-Reply-To: References: <20250212235023.391449-1-jmaloy@redhat.com> <20250214120058.178c4fba@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: q7cBVNoGSCDtpsNWdCr_y-bG4mIBG6urV9KrSTjtVfE_1739573840 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: S4ZQ5HK35SB3JVOLPWW6MGCQ3EP56NBL X-Message-ID-Hash: S4ZQ5HK35SB3JVOLPWW6MGCQ3EP56NBL X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, lvivier@redhat.com, dgibson@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, 14 Feb 2025 17:46:21 -0500 Jon Maloy wrote: > On 2025-02-14 06:00, Stefano Brivio wrote: > > On Wed, 12 Feb 2025 18:50:23 -0500 > > Jon Maloy wrote: > > > >> When studying the Linux source code and Wireshark dumps it seems like > >> the no_frag flag in the IPv4 header is always set. Following discussions > >> in the Internet on this subject indicates that modern routers never > >> fragment packets, and that it isn't even supported in many cases. > >> > >> Adding to this that incoming messages forwarded on the tap interface > >> never even pass through a router it seems safe to always set this flag. > >> > >> This makes the IPv4 headers of forwarded messages identical to those > >> sent by the external sockets, something we must consider desirable. > >> > >> Signed-off-by: Jon Maloy > >> --- > >> tap.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/tap.c b/tap.c > >> index d0673e5..44b0fc0 100644 > >> --- a/tap.c > >> +++ b/tap.c > >> @@ -153,7 +153,7 @@ static void *tap_push_ip4h(struct iphdr *ip4h, struct in_addr src, > >> ip4h->tos = 0; > >> ip4h->tot_len = htons(l3len); > >> ip4h->id = 0; > >> - ip4h->frag_off = 0; > >> + ip4h->frag_off = htons(IP_DF); > > > > $ tshark -r test/test_logs/pasta.pcap -V -Y frame.number==9 | grep "Header Checksum" > > Header Checksum: 0x07d4 incorrect, should be 0xc7d3(may be caused by "IP checksum offload"?) > > > > See L2_BUF_IP4_PSUM(). > > Not sure what to do about this. I don't even see we calculate the > checksum in our code We precalculate that part, see L2_BUF_IP4_PSUM() (and also L2_BUF_IP4_INIT()). > so does it matter? Well, I think it matters that we send out valid IPv4 packets. Try this change and see for yourself. -- Stefano