netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug report: MAC src + protocol optiomization failing with 802.1Q frames
@ 2025-10-12 20:59 Antoine C.
  2025-10-12 21:44 ` Florian Westphal
  0 siblings, 1 reply; 6+ messages in thread
From: Antoine C. @ 2025-10-12 20:59 UTC (permalink / raw)
  To: netfilter-devel

Hello,

Following the mails I sent on the user mailing list, it seems that
there is a bug occurring with the first rule below (the second is
fine):

# nft list table netdev t
table netdev t {
        chain c {
              ether saddr aa:bb:cc:dd:00:38 ip saddr 192.168.140.56 \
log prefix "--tests 1&2 --"
              ip saddr 192.168.140.56 ether saddr aa:bb:cc:dd:00:38 \
log prefix "--tests 2&1 --"
        }
}

It is translated this way:
netdev t c
  [ meta load iiftype => reg 1 ]
  [ cmp eq reg 1 0x00000001 ]
  [ payload load 8b @ link header + 6 => reg 1 ]
  [ cmp eq reg 1 0xddccbbaa 0x00083800 ]
  [ payload load 4b @ network header + 12 => reg 1 ]
  [ cmp eq reg 1 0x388ca8c0 ]
  [ log prefix --tests 1&2 -- ]

The MAC source and the protocol are loaded at the same time
then checked... but with an 802.1Q packet, it is actually 
wrong: the ethertype will be 0x8100 and the protocol (here 
IPv4, 0x0800), will be 4 bytes further. And it that case,
the second test above will succeed because the protocol 
is loaded independently.

I just tested with latest versions of libmnl/libnftnl/nft 
and I get the same behavior.

The mail on the netfilter-user ML:
https://marc.info/?l=netfilter&m=176011821517829

Regards,
Antoine

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-06 23:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-12 20:59 bug report: MAC src + protocol optiomization failing with 802.1Q frames Antoine C.
2025-10-12 21:44 ` Florian Westphal
2025-10-27 18:26   ` Antoine C.
2025-10-27 18:37     ` Florian Westphal
2025-10-27 22:40       ` Antoine C.
2025-11-06 23:46         ` Florian Westphal

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).