From: David Ahern <dsahern@kernel.org>
To: Eyal Birger <eyal.birger@gmail.com>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
andrea.mayer@uniroma2.it
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] vrf: fix packet sniffing for traffic originating from ip tunnels
Date: Thu, 31 Mar 2022 19:41:09 -0600 [thread overview]
Message-ID: <d49e7e72-49cd-fbc7-1b2e-7cc6e38b1dc6@kernel.org> (raw)
In-Reply-To: <20220331072643.3026742-1-eyal.birger@gmail.com>
On 3/31/22 1:26 AM, Eyal Birger wrote:
> in commit 048939088220
> ("vrf: add mac header for tunneled packets when sniffer is attached")
> an Ethernet header was cooked for traffic originating from tunnel devices.
>
> However, the header is added based on whether the mac_header is unset
> and ignores cases where the device doesn't expose a mac header to upper
> layers, such as in ip tunnels like ipip and gre.
>
> Traffic originating from such devices still appears garbled when capturing
> on the vrf device.
>
> Fix by observing whether the original device exposes a header to upper
> layers, similar to the logic done in af_packet.
>
> In addition, skb->mac_len needs to be adjusted after adding the Ethernet
> header for the skb_push/pull() surrounding dev_queue_xmit_nit() to work
> on these packets.
>
> Fixes: 048939088220 ("vrf: add mac header for tunneled packets when sniffer is attached")
> Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
> ---
> drivers/net/vrf.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2022-04-01 1:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 7:26 [PATCH net] vrf: fix packet sniffing for traffic originating from ip tunnels Eyal Birger
2022-04-01 1:41 ` David Ahern [this message]
2022-04-01 11:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d49e7e72-49cd-fbc7-1b2e-7cc6e38b1dc6@kernel.org \
--to=dsahern@kernel.org \
--cc=andrea.mayer@uniroma2.it \
--cc=davem@davemloft.net \
--cc=eyal.birger@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).