Re: [PATCH net-next v2] erspan: drop packets with an unknown ERSPAN version

From: Haishuang Yan

Date: Sun Nov 08 2026 - 04:24:27 EST


On Sun, Nov 08, 2026 at 05:03:49AM +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Can an ETH_P_ERSPAN2 frame with a 4-byte GRE header get around this new
> check?
>
> is_erspan_type1() looks only at gre_hdr_len and never checks
> tpi->proto:

[ ... ]

> Would it make sense to also require tpi->proto == htons(ETH_P_ERSPAN)
> when classifying a packet as type I, so this path is covered too?

Yes, this is right. gre_parse_header() takes an ERSPAN2 frame with
a 4-byte GRE header as one with an ERSPAN header, but erspan_rcv()
then treats it as type I and never looks at the version. Type I only
exists with protocol 0x88BE, so I'll make is_erspan_type1() check
tpi->proto as well and send a v3. ip6_gre has no type I path and is
not affected.

pw-bot: cr