mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE
CHECKSUM_COMPLETE signals that skb->csum stores the sum over the
entire packet. It does not imply that an embedded l4 checksum
field has been validated.
Fixes: 682f048bd4
("af_packet: pass checksum validation status to the user")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20221128161812.640098-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0e682f04b4
commit
b85f628aa1
1 changed files with 2 additions and 4 deletions
|
@ -2293,8 +2293,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||
if (skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
status |= TP_STATUS_CSUMNOTREADY;
|
||||
else if (skb->pkt_type != PACKET_OUTGOING &&
|
||||
(skb->ip_summed == CHECKSUM_COMPLETE ||
|
||||
skb_csum_unnecessary(skb)))
|
||||
skb_csum_unnecessary(skb))
|
||||
status |= TP_STATUS_CSUM_VALID;
|
||||
|
||||
if (snaplen > res)
|
||||
|
@ -3520,8 +3519,7 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
|||
if (skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
aux.tp_status |= TP_STATUS_CSUMNOTREADY;
|
||||
else if (skb->pkt_type != PACKET_OUTGOING &&
|
||||
(skb->ip_summed == CHECKSUM_COMPLETE ||
|
||||
skb_csum_unnecessary(skb)))
|
||||
skb_csum_unnecessary(skb))
|
||||
aux.tp_status |= TP_STATUS_CSUM_VALID;
|
||||
|
||||
aux.tp_len = origlen;
|
||||
|
|
Loading…
Reference in a new issue