diff options
author | Tom Herbert <therbert@google.com> | 2014-05-23 11:47:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-23 16:28:53 -0400 |
commit | 28448b80456feafe07e2d05b6363b00f61f6171e (patch) | |
tree | ad45836de4e3bdb441a78f825d7f53ed8e8c7096 /net/l2tp | |
parent | b26ba202e0500eb852e89499ece1b2deaa64c3a7 (diff) |
net: Split sk_no_check into sk_no_check_{rx,tx}
Define separate fields in the sock structure for configuring disabling
checksums in both TX and RX-- sk_no_check_tx and sk_no_check_rx.
The SO_NO_CHECK socket option only affects sk_no_check_tx. Also,
removed UDP_CSUM_* defines since they are no longer necessary.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r-- | net/l2tp/l2tp_core.c | 4 | ||||
-rw-r--r-- | net/l2tp/l2tp_netlink.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index ed0716a075ba..a1186105f537 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
@@ -1188,7 +1188,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1188 | l2tp_xmit_ipv6_csum(sk, skb, udp_len); | 1188 | l2tp_xmit_ipv6_csum(sk, skb, udp_len); |
1189 | else | 1189 | else |
1190 | #endif | 1190 | #endif |
1191 | if (sk->sk_no_check == UDP_CSUM_NOXMIT) | 1191 | if (sk->sk_no_check_tx) |
1192 | skb->ip_summed = CHECKSUM_NONE; | 1192 | skb->ip_summed = CHECKSUM_NONE; |
1193 | else if ((skb_dst(skb) && skb_dst(skb)->dev) && | 1193 | else if ((skb_dst(skb) && skb_dst(skb)->dev) && |
1194 | (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM))) { | 1194 | (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM))) { |
@@ -1463,7 +1463,7 @@ static int l2tp_tunnel_sock_create(struct net *net, | |||
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | if (!cfg->use_udp_checksums) | 1465 | if (!cfg->use_udp_checksums) |
1466 | sock->sk->sk_no_check = UDP_CSUM_NOXMIT; | 1466 | sock->sk->sk_no_check_tx = 1; |
1467 | 1467 | ||
1468 | break; | 1468 | break; |
1469 | 1469 | ||
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index bd7387adea9e..f3d331bdd706 100644 --- a/net/l2tp/l2tp_netlink.c +++ b/net/l2tp/l2tp_netlink.c | |||
@@ -297,8 +297,7 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int fla | |||
297 | case L2TP_ENCAPTYPE_UDP: | 297 | case L2TP_ENCAPTYPE_UDP: |
298 | if (nla_put_u16(skb, L2TP_ATTR_UDP_SPORT, ntohs(inet->inet_sport)) || | 298 | if (nla_put_u16(skb, L2TP_ATTR_UDP_SPORT, ntohs(inet->inet_sport)) || |
299 | nla_put_u16(skb, L2TP_ATTR_UDP_DPORT, ntohs(inet->inet_dport)) || | 299 | nla_put_u16(skb, L2TP_ATTR_UDP_DPORT, ntohs(inet->inet_dport)) || |
300 | nla_put_u8(skb, L2TP_ATTR_UDP_CSUM, | 300 | nla_put_u8(skb, L2TP_ATTR_UDP_CSUM, !sk->sk_no_check_tx)) |
301 | (sk->sk_no_check != UDP_CSUM_NOXMIT))) | ||
302 | goto nla_put_failure; | 301 | goto nla_put_failure; |
303 | /* NOBREAK */ | 302 | /* NOBREAK */ |
304 | case L2TP_ENCAPTYPE_IP: | 303 | case L2TP_ENCAPTYPE_IP: |