Skip to contentSkip to conversation

ipv6: udp: check sk->sk_no_check when sending udpv6 packet

PATCH NAK Duan Jiong 3 participants 3 messages Jan 20, 2014

Subsystems (3)
lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 ipv6: udp: check sk->sk_no_check when sending udpv6 packet

According to the user's intention, if SO_NO_CHECK option is set to true, the udpv6 packet should be out with no checksum.

---
 net/ipv6/udp.c | 4 ++++
 1 file changed, 4 insertions(+)
net/ipv6/udp.c +4 -0
index 089c741..8808c69 100644
@@ -1001,6 +1001,10 @@ static int udp_v6_push_pending_frames(struct sock *sk)
 
 	if (is_udplite)
 		csum = udplite_csum_outgoing(sk, skb);
+	else if (sk->sk_no_check == UDP_CSUM_NOXMIT) {
+		skb->ip_summed = CHECKSUM_NONE;
+		goto send;
+	}
 	else if (skb->ip_summed == CHECKSUM_PARTIAL) { /* UDP hardware csum */
 		udp6_hwcsum_outgoing(sk, skb, &fl6->saddr, &fl6->daddr,
 				     up->len);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: Duan Jiong <[email protected]>
Date: Mon, 20 Jan 2014 11:51:01 +0800

Quoted 4 lines

According to the user's intention, if SO_NO_CHECK option is set to true, the udpv6 packet should be out with no checksum.

This is intentionally not supported in ipv6.

#2 lore raw
In reply to Duan Jiong
Quoted 3 lines · Duan Jiong

According to the user's intention, if SO_NO_CHECK option is set to true, the udpv6 packet should be out with no checksum.

Nak, UDP checksumming is mandatory when used with IPv6.

Greetings,

Hannes