From: "Antoine C." <acalando@free.fr>
To: netfilter-devel@vger.kernel.org
Subject: bug report: MAC src + protocol optiomization failing with 802.1Q frames
Date: Sun, 12 Oct 2025 22:59:46 +0200 (CEST) [thread overview]
Message-ID: <2093285391.1388199126.1760302786604.JavaMail.root@zimbra62-e11.priv.proxad.net> (raw)
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
next reply other threads:[~2025-10-12 21:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 20:59 Antoine C. [this message]
2025-10-12 21:44 ` bug report: MAC src + protocol optiomization failing with 802.1Q frames 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
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=2093285391.1388199126.1760302786604.JavaMail.root@zimbra62-e11.priv.proxad.net \
--to=acalando@free.fr \
--cc=netfilter-devel@vger.kernel.org \
/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).