]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfilter: flowtable: fix inline vlan encapsulation in xmit path
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 30 Apr 2026 14:49:51 +0000 (16:49 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 30 Apr 2026 23:23:47 +0000 (01:23 +0200)
commita177ae30f78688f75ef9c6277a152c5d6979b10e
treee5d1f8137b0472c3f8420d21339ef4479f6d00af
parentef4f741e8627512cb8c82f59a1fc7aacd854aadf
netfilter: flowtable: fix inline vlan encapsulation in xmit path

Several issues in the inline vlan support:

- The layer 2 encapsulation representation in the tuple takes encap[0] as
  the outer header and encap[1] as the inner header as seen from the ingress
  path. Reverse the encap loop to push first the inner then the outer vlan
  header.

- Postpone pushing the layer 2 header once destination device is known.
  This allows to calculate the needed hearoom via LL_RESERVED_SPACE to
  accommodate the layer 2 headers.

- Add and use nf_flow_vlan_push() as suggested by Eric Woudstra, this
  is a simplified version of skb_vlan_push() for egress path only.

Fixes: c653d5a78f34 ("netfilter: flowtable: inline vlan encapsulation in xmit path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_ip.c