From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8EDCC4742C for ; Tue, 10 Nov 2020 22:50:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88F9D20781 for ; Tue, 10 Nov 2020 22:50:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="RBeviLq2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732511AbgKJWus (ORCPT ); Tue, 10 Nov 2020 17:50:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:52060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730254AbgKJWus (ORCPT ); Tue, 10 Nov 2020 17:50:48 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6DDC220780; Tue, 10 Nov 2020 22:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605048647; bh=WcboRWl77JWuNzjg4I9C64dxGXdRBQo6lbR/ydIN3RA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RBeviLq2IcezpX/bHnESfoisdefgA6FWEdHXUeN7mhgcNl562iTpOs8HTYkO5hWAT CTgwn+lkzPOR2gWc0ttow4O8DwiC8xHFkCHpJ47ws3WHAxhIBr8RzvbdgskueFyXCc 7vf3BslIPWcaX2t9B57NB+Vmo/3Mx7vS7PE/jVOw= Date: Tue, 10 Nov 2020 14:50:45 -0800 From: Jakub Kicinski To: Andrea Mayer Cc: "David S. Miller" , David Ahern , Alexey Kuznetsov , Hideaki YOSHIFUJI , Shuah Khan , Shrijeet Mukherjee , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam Subject: Re: [net-next,v2,1/5] vrf: add mac header for tunneled packets when sniffer is attached Message-ID: <20201110145045.22dfd58e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201107153139.3552-2-andrea.mayer@uniroma2.it> References: <20201107153139.3552-1-andrea.mayer@uniroma2.it> <20201107153139.3552-2-andrea.mayer@uniroma2.it> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 7 Nov 2020 16:31:35 +0100 Andrea Mayer wrote: > Before this patch, a sniffer attached to a VRF used as the receiving > interface of L3 tunneled packets detects them as malformed packets and > it complains about that (i.e.: tcpdump shows bogus packets). > > The reason is that a tunneled L3 packet does not carry any L2 > information and when the VRF is set as the receiving interface of a > decapsulated L3 packet, no mac header is currently set or valid. > Therefore, the purpose of this patch consists of adding a MAC header to > any packet which is directly received on the VRF interface ONLY IF: > > i) a sniffer is attached on the VRF and ii) the mac header is not set. > > In this case, the mac address of the VRF is copied in both the > destination and the source address of the ethernet header. The protocol > type is set either to IPv4 or IPv6, depending on which L3 packet is > received. > > Signed-off-by: Andrea Mayer Please keep David's review tag since you haven't changed the code.