[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <52DC9D25.9070809@cn.fujitsu.com>
Date: Mon, 20 Jan 2014 11:51:01 +0800
From: Duan Jiong <duanj.fnst@...fujitsu.com>
To: David Miller <davem@...emloft.net>
CC: netdev <netdev@...r.kernel.org>
Subject: [PATCH] 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.
Signed-off-by: Duan Jiong <duanj.fnst@...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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists