summaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_core.c
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-05-23 08:47:40 -0700
committerDavid S. Miller <davem@davemloft.net>2014-05-23 16:28:53 -0400
commit6b649feafe10b293f4bd5a74aca95faf625ae525 (patch)
tree842991b315c84e51fa4c2ececfba60e2992944b9 /net/l2tp/l2tp_core.c
parent1c19448c9ba6545b80ded18488a64a7f3d8e6998 (diff)
downloadlinux-6b649feafe10b293f4bd5a74aca95faf625ae525.tar.gz
linux-6b649feafe10b293f4bd5a74aca95faf625ae525.tar.bz2
linux-6b649feafe10b293f4bd5a74aca95faf625ae525.zip
l2tp: Add support for zero IPv6 checksums
Added new L2TP configuration options to allow TX and RX of zero checksums in IPv6. Default is not to use them. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_core.c')
-rw-r--r--net/l2tp/l2tp_core.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index a1186105f537..379558014b60 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1102,7 +1102,9 @@ static void l2tp_xmit_ipv6_csum(struct sock *sk, struct sk_buff *skb,
struct ipv6_pinfo *np = inet6_sk(sk);
struct udphdr *uh = udp_hdr(skb);
- if (!skb_dst(skb) || !skb_dst(skb)->dev ||
+ if (udp_get_no_check6_tx(sk))
+ skb->ip_summed = CHECKSUM_NONE;
+ else if (!skb_dst(skb) || !skb_dst(skb)->dev ||
!(skb_dst(skb)->dev->features & NETIF_F_IPV6_CSUM)) {
__wsum csum = skb_checksum(skb, 0, udp_len, 0);
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1435,6 +1437,11 @@ static int l2tp_tunnel_sock_create(struct net *net,
sizeof(udp6_addr), 0);
if (err < 0)
goto out;
+
+ if (cfg->udp6_zero_tx_checksums)
+ udp_set_no_check6_tx(sock->sk, true);
+ if (cfg->udp6_zero_rx_checksums)
+ udp_set_no_check6_rx(sock->sk, true);
} else
#endif
{