aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem de Bruijn2020-01-29 14:20:17 -0600
committerGreg Kroah-Hartman2020-05-10 03:31:33 -0500
commit8e054bd6dfc4e87a71c27f038e4b75dfc0851492 (patch)
treed6867b1009c9fc8c11d1e4b7cb9b1f84807a8efc
parent2a03c23b2015c6834becd41037e7286e62d5cd17 (diff)
downloadkernel-8e054bd6dfc4e87a71c27f038e4b75dfc0851492.tar.gz
kernel-8e054bd6dfc4e87a71c27f038e4b75dfc0851492.tar.xz
kernel-8e054bd6dfc4e87a71c27f038e4b75dfc0851492.zip
udp: document udp_rcv_segment special case for looped packets
commit d0208bf4da97f76237300afb83c097de25645de6 upstream. Commit 6cd021a58c18a ("udp: segment looped gso packets correctly") fixes an issue with rare udp gso multicast packets looped onto the receive path. The stable backport makes the narrowest change to target only these packets, when needed. As opposed to, say, expanding __udp_gso_segment, which is harder to reason to be free from unintended side-effects. But the resulting code is hardly self-describing. Document its purpose and rationale. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--include/net/udp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index 8f163d674f07..fabf507bce5d 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -476,6 +476,13 @@ static inline struct sk_buff *udp_rcv_segment(struct sock *sk,
476 if (!inet_get_convert_csum(sk)) 476 if (!inet_get_convert_csum(sk))
477 features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 477 features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
478 478
479 /* UDP segmentation expects packets of type CHECKSUM_PARTIAL or
480 * CHECKSUM_NONE in __udp_gso_segment. UDP GRO indeed builds partial
481 * packets in udp_gro_complete_segment. As does UDP GSO, verified by
482 * udp_send_skb. But when those packets are looped in dev_loopback_xmit
483 * their ip_summed is set to CHECKSUM_UNNECESSARY. Reset in this
484 * specific case, where PARTIAL is both correct and required.
485 */
479 if (skb->pkt_type == PACKET_LOOPBACK) 486 if (skb->pkt_type == PACKET_LOOPBACK)
480 skb->ip_summed = CHECKSUM_PARTIAL; 487 skb->ip_summed = CHECKSUM_PARTIAL;
481 488