From 217e6516aa4069a555a758478333e476eadcf461 Mon Sep 17 00:00:00 2001 From: Cyril Strejc Date: Fri, 8 Oct 2021 21:30:53 +0200 Subject: [PATCH] net: multicast: calc csum of looped-back and forwarded packets Signed-off-by: Cyril Strejc --- include/linux/skbuff.h | 5 ++++- net/core/dev.c | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 841e2f0f5240..bbfa6b259bf3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -4048,7 +4048,10 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb, bool zero_okay, __sum16 check) { - if (skb_csum_unnecessary(skb) || (zero_okay && !check)) { + if (skb_csum_unnecessary(skb) || + (zero_okay && !check) || + (skb->pkt_type == PACKET_LOOPBACK)) + { skb->csum_valid = 1; __skb_decr_checksum_unnecessary(skb); return false; diff --git a/net/core/dev.c b/net/core/dev.c index 7ee9fecd3aff..ba4a0994d97b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3906,7 +3906,6 @@ int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *skb) skb_reset_mac_header(skb); __skb_pull(skb, skb_network_offset(skb)); skb->pkt_type = PACKET_LOOPBACK; - skb->ip_summed = CHECKSUM_UNNECESSARY; WARN_ON(!skb_dst(skb)); skb_dst_force(skb); netif_rx_ni(skb); -- 2.25.1