netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: udp: check sk->sk_no_check when sending udpv6 packet
@ 2014-01-20  3:51 Duan Jiong
  2014-01-20  3:54 ` David Miller
  2014-01-20  3:54 ` Hannes Frederic Sowa
  0 siblings, 2 replies; 3+ messages in thread
From: Duan Jiong @ 2014-01-20  3:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


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

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 net/ipv6/udp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 089c741..8808c69 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -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);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: udp: check sk->sk_no_check when sending udpv6 packet
  2014-01-20  3:51 [PATCH] ipv6: udp: check sk->sk_no_check when sending udpv6 packet Duan Jiong
@ 2014-01-20  3:54 ` David Miller
  2014-01-20  3:54 ` Hannes Frederic Sowa
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-01-20  3:54 UTC (permalink / raw)
  To: duanj.fnst; +Cc: netdev

From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Mon, 20 Jan 2014 11:51:01 +0800

> According to the user's intention, if SO_NO_CHECK option is
> set to true, the udpv6 packet should be out with no checksum.
> 
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>

This is intentionally not supported in ipv6.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: udp: check sk->sk_no_check when sending udpv6 packet
  2014-01-20  3:51 [PATCH] ipv6: udp: check sk->sk_no_check when sending udpv6 packet Duan Jiong
  2014-01-20  3:54 ` David Miller
@ 2014-01-20  3:54 ` Hannes Frederic Sowa
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Frederic Sowa @ 2014-01-20  3:54 UTC (permalink / raw)
  To: Duan Jiong; +Cc: David Miller, netdev

On Mon, Jan 20, 2014 at 11:51:01AM +0800, Duan Jiong wrote:
> 
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-20  3:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20  3:51 [PATCH] ipv6: udp: check sk->sk_no_check when sending udpv6 packet Duan Jiong
2014-01-20  3:54 ` David Miller
2014-01-20  3:54 ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).