Thread (14 messages) flat view 14 messages, 2 authors, 3d ago
WARM3d

[PATCH net-next 06/10] macsec: do not assume mac header is set in macsec_encrypt_finish()

From: Eric Dumazet <edumazet@google.com>
Date: 2026-09-02 00:33:56
Subsystem: networking drivers, networking [macsec], the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Sabrina Dubroca, Linus Torvalds

We should not assume mac header is set in output path.

Use skb_eth_hdr() instead of eth_hdr() to fix the issue,
and remove now redundant skb_reset_mac_header().

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 drivers/net/macsec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 6f9f3aceffaad311d5d47bb93fa0df59082aa9f9..da7f917e71807410c050bcf4a8ed836272ab87cb 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -503,8 +503,7 @@ static void macsec_encrypt_finish(struct sk_buff *skb, struct net_device *dev)
 	struct macsec_dev *macsec = netdev_priv(dev);
 
 	skb->dev = macsec->real_dev;
-	skb_reset_mac_header(skb);
-	skb->protocol = eth_hdr(skb)->h_proto;
+	skb->protocol = skb_eth_hdr(skb)->h_proto;
 }
 
 static unsigned int macsec_msdu_len(struct sk_buff *skb)
-- 
2.55.0.966.g6673acef38-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help