OK no worries Andrew.
The motivation was just a correctness fix to align the parser with the
intention of the original commit, which set VLAN_MAX_DEPTH to 8.
I'll re-submit to net-next when the window reopens.
cheers,
avi
On Sun, Nov 1, 2026 at 9:50 PM Andrew Lunn [off-list ref] wrote:
On Sun, Nov 01, 2026 at 04:58:42PM +0200, Avi Weiss wrote:
quoted
__vlan_get_protocol_offset() starts with VLAN_MAX_DEPTH (8) but
pre-decrements parse_depth before checking it. This rejects the eighth
VLAN header and returns protocol 0 instead of the encapsulated EtherType.
When skb->mac_len is ETH_HLEN, the first iteration rereads the outer
EtherType, so eight VLAN tags require nine iterations. Check the counter
before decrementing it and allow one extra iteration in this case.
Fixes: 469aceddfa3e ("vlan: consolidate VLAN parsing code and limit max parsing depth")
Do you have a use case for 8 nested VLANs?
Have you seen people reporting issues? Does this bother anybody?
If not, i suggest you drop the Fixes: tag and post to net-next.
Andrew