From: David 'equinox' Lamparter <equinox@diac24.net>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
David 'equinox' Lamparter <equinox@diac24.net>
Subject: [RFC PATCH net-next 1/2] llc: add 802.1AC (jumbo frames) support
Date: Mon, 13 Jul 2026 14:43:38 +0200 [thread overview]
Message-ID: <20260713124545.462790-2-equinox@diac24.net> (raw)
In-Reply-To: <20260713124545.462790-1-equinox@diac24.net>
Length values in the ethertype field only go up to 1500 (with 1501 to
1535 undefined). 802.1AC (2016 Cor1-2018) defines 0x8870 to use as
ethertype for LLC frames with a length > 1500.
Easy enough to implement. Frames 1500 bytes or shorter are explicitly
rejected when received with ethertype 0x8870 since that could be abused
to smuggle packets past filters. (It could also cause compatibility
issues when mixing in other devices that don't understand that value.)
A kernel self-test is coming up separately.
(background: the IS-IS routing protocol uses LLC/CLNS. FRRouting
currently uses AF_PACKET ETH_P_ALL sockets for that, which is a bit
overkill. Using AF_LLC instead was exploratory, but this fell out as a
side effect. Two AF_PACKET sockets, ETH_P_802_2 + ETH_P_8021AC, is
probably a better option though.)
Signed-off-by: David 'equinox' Lamparter <equinox@diac24.net>
---
net/llc/llc_core.c | 7 +++++++
net/llc/llc_input.c | 11 +++++++++++
net/llc/llc_output.c | 6 ++++--
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c
index 5b0f1986bddc..81cd04a8e7e3 100644
--- a/net/llc/llc_core.c
+++ b/net/llc/llc_core.c
@@ -129,14 +129,21 @@ static struct packet_type llc_packet_type __read_mostly = {
.func = llc_rcv,
};
+static struct packet_type llc_packet_type_8021ac __read_mostly = {
+ .type = cpu_to_be16(ETH_P_8021AC),
+ .func = llc_rcv,
+};
+
static int __init llc_init(void)
{
dev_add_pack(&llc_packet_type);
+ dev_add_pack(&llc_packet_type_8021ac);
return 0;
}
static void __exit llc_exit(void)
{
+ dev_remove_pack(&llc_packet_type_8021ac);
dev_remove_pack(&llc_packet_type);
}
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 8eb3d73c39d1..9409da626b9c 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -120,6 +120,11 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
skb_pull(skb, llc_len);
skb_reset_transport_header(skb);
+
+ /* trimming the checksum is not necessary for 802.1AC since the
+ * frames are required to be larger than 1500 bytes, thus have no
+ * ethernet padding
+ */
if (skb->protocol == htons(ETH_P_802_2)) {
__be16 pdulen;
s32 data_size;
@@ -135,6 +140,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
return 0;
if (unlikely(pskb_trim_rcsum(skb, data_size)))
return 0;
+ } else if (skb->protocol == htons(ETH_P_8021AC)) {
+ /* don't accept non-jumbo 802.1AC frames, it could be used to
+ * bypass filters on 802.2. Minimum 1497 + 1 byte.
+ */
+ if (!pskb_may_pull(skb, 1497 + 1))
+ return 0;
}
return 1;
}
diff --git a/net/llc/llc_output.c b/net/llc/llc_output.c
index 5a6466fc626a..16efe273188f 100644
--- a/net/llc/llc_output.c
+++ b/net/llc/llc_output.c
@@ -26,12 +26,14 @@ int llc_mac_hdr_init(struct sk_buff *skb,
const unsigned char *sa, const unsigned char *da)
{
int rc = -EINVAL;
+ unsigned short proto;
switch (skb->dev->type) {
case ARPHRD_ETHER:
case ARPHRD_LOOPBACK:
- rc = dev_hard_header(skb, skb->dev, ETH_P_802_2, da, sa,
- skb->len);
+ proto = skb->len > 1500 ? ETH_P_8021AC : ETH_P_802_2;
+ skb->protocol = htons(proto);
+ rc = dev_hard_header(skb, skb->dev, proto, da, sa, skb->len);
if (rc > 0)
rc = 0;
break;
--
2.53.0
next prev parent reply other threads:[~2026-07-13 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 12:43 [RFC net-next] llc: jumbo frame support David 'equinox' Lamparter
2026-07-13 12:43 ` David 'equinox' Lamparter [this message]
2026-07-13 12:43 ` [RFC PATCH net-next 2/2] selftests/net: selftest for AF_LLC jumbo frames David 'equinox' Lamparter
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=20260713124545.462790-2-equinox@diac24.net \
--to=equinox@diac24.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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