[RFC PATCH net-next 1/2] llc: add 802.1AC (jumbo frames) support
From: David 'equinox' Lamparter <hidden>
Date: 2026-07-13 12:45:57
Subsystem:
llc (802.2), networking [general], the rest · Maintainers:
"David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
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 <redacted> --- 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