RE: [PATCH v2 net 2/6] net: enetc: linearize PTP event packets with one-step TX timestamping

From: Wei Fang

Date: Wed Apr 08 2026 - 00:44:30 EST


> Sashiko reports that enetc_ptp_parse() uses ptp_parse_header(), which
> does not handle fragmented headers, and expects the entire area between
> skb_mac_header() and the end of the PTP header to be linear.

I think we should correct the check in ptp_parse_header().

@@ -130,7 +130,7 @@ struct ptp_header *ptp_parse_header(struct sk_buff *skb, unsigned int type)
ptr += ETH_HLEN;

/* Ensure that the entire header is present in this packet. */
- if (ptr + sizeof(struct ptp_header) > skb->data + skb->len)
+ if (ptr + sizeof(struct ptp_header) > skb->data + skb_headlen(skb))
return NULL;