diff options
author | Wang Yufen <wangyufen@huawei.com> | 2014-03-28 21:27:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-31 16:16:16 -0400 |
commit | 4aa956d801470c9d338f6095e2cf9a5b58909337 (patch) | |
tree | 9365feaf55355c907f6e284a66bbbad2e3e00055 /net | |
parent | 788367fdb30329d9db92c89a7b9ca1a0cbea5c36 (diff) |
ipv6: tcp_ipv6 do some cleanup
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 3277680186b4..10b7c0478830 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <linux/ipsec.h> | 39 | #include <linux/ipsec.h> |
40 | #include <linux/times.h> | 40 | #include <linux/times.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | 42 | #include <linux/uaccess.h> | |
43 | #include <linux/ipv6.h> | 43 | #include <linux/ipv6.h> |
44 | #include <linux/icmpv6.h> | 44 | #include <linux/icmpv6.h> |
45 | #include <linux/random.h> | 45 | #include <linux/random.h> |
@@ -65,8 +65,6 @@ | |||
65 | #include <net/tcp_memcontrol.h> | 65 | #include <net/tcp_memcontrol.h> |
66 | #include <net/busy_poll.h> | 66 | #include <net/busy_poll.h> |
67 | 67 | ||
68 | #include <asm/uaccess.h> | ||
69 | |||
70 | #include <linux/proc_fs.h> | 68 | #include <linux/proc_fs.h> |
71 | #include <linux/seq_file.h> | 69 | #include <linux/seq_file.h> |
72 | 70 | ||
@@ -532,8 +530,8 @@ static struct tcp_md5sig_key *tcp_v6_reqsk_md5_lookup(struct sock *sk, | |||
532 | return tcp_v6_md5_do_lookup(sk, &inet_rsk(req)->ir_v6_rmt_addr); | 530 | return tcp_v6_md5_do_lookup(sk, &inet_rsk(req)->ir_v6_rmt_addr); |
533 | } | 531 | } |
534 | 532 | ||
535 | static int tcp_v6_parse_md5_keys (struct sock *sk, char __user *optval, | 533 | static int tcp_v6_parse_md5_keys(struct sock *sk, char __user *optval, |
536 | int optlen) | 534 | int optlen) |
537 | { | 535 | { |
538 | struct tcp_md5sig cmd; | 536 | struct tcp_md5sig cmd; |
539 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&cmd.tcpm_addr; | 537 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&cmd.tcpm_addr; |
@@ -717,7 +715,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = { | |||
717 | .send_ack = tcp_v6_reqsk_send_ack, | 715 | .send_ack = tcp_v6_reqsk_send_ack, |
718 | .destructor = tcp_v6_reqsk_destructor, | 716 | .destructor = tcp_v6_reqsk_destructor, |
719 | .send_reset = tcp_v6_send_reset, | 717 | .send_reset = tcp_v6_send_reset, |
720 | .syn_ack_timeout = tcp_syn_ack_timeout, | 718 | .syn_ack_timeout = tcp_syn_ack_timeout, |
721 | }; | 719 | }; |
722 | 720 | ||
723 | #ifdef CONFIG_TCP_MD5SIG | 721 | #ifdef CONFIG_TCP_MD5SIG |
@@ -1261,7 +1259,8 @@ static struct sock *tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1261 | 1259 | ||
1262 | #ifdef CONFIG_TCP_MD5SIG | 1260 | #ifdef CONFIG_TCP_MD5SIG |
1263 | /* Copy over the MD5 key from the original socket */ | 1261 | /* Copy over the MD5 key from the original socket */ |
1264 | if ((key = tcp_v6_md5_do_lookup(sk, &newsk->sk_v6_daddr)) != NULL) { | 1262 | key = tcp_v6_md5_do_lookup(sk, &newsk->sk_v6_daddr); |
1263 | if (key != NULL) { | ||
1265 | /* We're using one, so create a matching key | 1264 | /* We're using one, so create a matching key |
1266 | * on the newsk structure. If we fail to get | 1265 | * on the newsk structure. If we fail to get |
1267 | * memory, then we end up not copying the key | 1266 | * memory, then we end up not copying the key |
@@ -1305,9 +1304,8 @@ static __sum16 tcp_v6_checksum_init(struct sk_buff *skb) | |||
1305 | &ipv6_hdr(skb)->saddr, | 1304 | &ipv6_hdr(skb)->saddr, |
1306 | &ipv6_hdr(skb)->daddr, 0)); | 1305 | &ipv6_hdr(skb)->daddr, 0)); |
1307 | 1306 | ||
1308 | if (skb->len <= 76) { | 1307 | if (skb->len <= 76) |
1309 | return __skb_checksum_complete(skb); | 1308 | return __skb_checksum_complete(skb); |
1310 | } | ||
1311 | return 0; | 1309 | return 0; |
1312 | } | 1310 | } |
1313 | 1311 | ||
@@ -1337,7 +1335,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1337 | return tcp_v4_do_rcv(sk, skb); | 1335 | return tcp_v4_do_rcv(sk, skb); |
1338 | 1336 | ||
1339 | #ifdef CONFIG_TCP_MD5SIG | 1337 | #ifdef CONFIG_TCP_MD5SIG |
1340 | if (tcp_v6_inbound_md5_hash (sk, skb)) | 1338 | if (tcp_v6_inbound_md5_hash(sk, skb)) |
1341 | goto discard; | 1339 | goto discard; |
1342 | #endif | 1340 | #endif |
1343 | 1341 | ||
@@ -1604,7 +1602,8 @@ do_time_wait: | |||
1604 | break; | 1602 | break; |
1605 | case TCP_TW_RST: | 1603 | case TCP_TW_RST: |
1606 | goto no_tcp_socket; | 1604 | goto no_tcp_socket; |
1607 | case TCP_TW_SUCCESS:; | 1605 | case TCP_TW_SUCCESS: |
1606 | ; | ||
1608 | } | 1607 | } |
1609 | goto discard_it; | 1608 | goto discard_it; |
1610 | } | 1609 | } |
@@ -1649,7 +1648,7 @@ static void tcp_v6_early_demux(struct sk_buff *skb) | |||
1649 | static struct timewait_sock_ops tcp6_timewait_sock_ops = { | 1648 | static struct timewait_sock_ops tcp6_timewait_sock_ops = { |
1650 | .twsk_obj_size = sizeof(struct tcp6_timewait_sock), | 1649 | .twsk_obj_size = sizeof(struct tcp6_timewait_sock), |
1651 | .twsk_unique = tcp_twsk_unique, | 1650 | .twsk_unique = tcp_twsk_unique, |
1652 | .twsk_destructor= tcp_twsk_destructor, | 1651 | .twsk_destructor = tcp_twsk_destructor, |
1653 | }; | 1652 | }; |
1654 | 1653 | ||
1655 | static const struct inet_connection_sock_af_ops ipv6_specific = { | 1654 | static const struct inet_connection_sock_af_ops ipv6_specific = { |
@@ -1683,7 +1682,6 @@ static const struct tcp_sock_af_ops tcp_sock_ipv6_specific = { | |||
1683 | /* | 1682 | /* |
1684 | * TCP over IPv4 via INET6 API | 1683 | * TCP over IPv4 via INET6 API |
1685 | */ | 1684 | */ |
1686 | |||
1687 | static const struct inet_connection_sock_af_ops ipv6_mapped = { | 1685 | static const struct inet_connection_sock_af_ops ipv6_mapped = { |
1688 | .queue_xmit = ip_queue_xmit, | 1686 | .queue_xmit = ip_queue_xmit, |
1689 | .send_check = tcp_v4_send_check, | 1687 | .send_check = tcp_v4_send_check, |