Skip to content

Commit d0208bf

Browse files
wdebruijdavem330
authored andcommitted
udp: document udp_rcv_segment special case for looped packets
Commit 6cd021a ("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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 389b8fb commit d0208bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/net/udp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,13 @@ static inline struct sk_buff *udp_rcv_segment(struct sock *sk,
476476
if (!inet_get_convert_csum(sk))
477477
features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
478478

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+
*/
479486
if (skb->pkt_type == PACKET_LOOPBACK)
480487
skb->ip_summed = CHECKSUM_PARTIAL;
481488

0 commit comments

Comments
 (0)