aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index febfd595a40d..9b6dbba80d31 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -520,6 +520,13 @@ done:
520 return err; 520 return err;
521} 521}
522 522
523static int tcp_v6_rtx_synack(struct sock *sk, struct request_sock *req,
524 struct request_values *rvp)
525{
526 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_RETRANSSEGS);
527 return tcp_v6_send_synack(sk, req, rvp);
528}
529
523static inline void syn_flood_warning(struct sk_buff *skb) 530static inline void syn_flood_warning(struct sk_buff *skb)
524{ 531{
525#ifdef CONFIG_SYN_COOKIES 532#ifdef CONFIG_SYN_COOKIES
@@ -876,7 +883,7 @@ static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb)
876 883
877 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 884 if (genhash || memcmp(hash_location, newhash, 16) != 0) {
878 if (net_ratelimit()) { 885 if (net_ratelimit()) {
879 printk(KERN_INFO "MD5 Hash %s for (%pI6, %u)->(%pI6, %u)\n", 886 printk(KERN_INFO "MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n",
880 genhash ? "failed" : "mismatch", 887 genhash ? "failed" : "mismatch",
881 &ip6h->saddr, ntohs(th->source), 888 &ip6h->saddr, ntohs(th->source),
882 &ip6h->daddr, ntohs(th->dest)); 889 &ip6h->daddr, ntohs(th->dest));
@@ -890,10 +897,11 @@ static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb)
890struct request_sock_ops tcp6_request_sock_ops __read_mostly = { 897struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
891 .family = AF_INET6, 898 .family = AF_INET6,
892 .obj_size = sizeof(struct tcp6_request_sock), 899 .obj_size = sizeof(struct tcp6_request_sock),
893 .rtx_syn_ack = tcp_v6_send_synack, 900 .rtx_syn_ack = tcp_v6_rtx_synack,
894 .send_ack = tcp_v6_reqsk_send_ack, 901 .send_ack = tcp_v6_reqsk_send_ack,
895 .destructor = tcp_v6_reqsk_destructor, 902 .destructor = tcp_v6_reqsk_destructor,
896 .send_reset = tcp_v6_send_reset 903 .send_reset = tcp_v6_send_reset,
904 .syn_ack_timeout = tcp_syn_ack_timeout,
897}; 905};
898 906
899#ifdef CONFIG_TCP_MD5SIG 907#ifdef CONFIG_TCP_MD5SIG
@@ -1732,8 +1740,11 @@ process:
1732 if (!tcp_prequeue(sk, skb)) 1740 if (!tcp_prequeue(sk, skb))
1733 ret = tcp_v6_do_rcv(sk, skb); 1741 ret = tcp_v6_do_rcv(sk, skb);
1734 } 1742 }
1735 } else 1743 } else if (unlikely(sk_add_backlog(sk, skb))) {
1736 sk_add_backlog(sk, skb); 1744 bh_unlock_sock(sk);
1745 NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP);
1746 goto discard_and_relse;
1747 }
1737 bh_unlock_sock(sk); 1748 bh_unlock_sock(sk);
1738 1749
1739 sock_put(sk); 1750 sock_put(sk);
@@ -2105,7 +2116,7 @@ static struct tcp_seq_afinfo tcp6_seq_afinfo = {
2105 }, 2116 },
2106}; 2117};
2107 2118
2108int tcp6_proc_init(struct net *net) 2119int __net_init tcp6_proc_init(struct net *net)
2109{ 2120{
2110 return tcp_proc_register(net, &tcp6_seq_afinfo); 2121 return tcp_proc_register(net, &tcp6_seq_afinfo);
2111} 2122}
@@ -2174,18 +2185,18 @@ static struct inet_protosw tcpv6_protosw = {
2174 INET_PROTOSW_ICSK, 2185 INET_PROTOSW_ICSK,
2175}; 2186};
2176 2187
2177static int tcpv6_net_init(struct net *net) 2188static int __net_init tcpv6_net_init(struct net *net)
2178{ 2189{
2179 return inet_ctl_sock_create(&net->ipv6.tcp_sk, PF_INET6, 2190 return inet_ctl_sock_create(&net->ipv6.tcp_sk, PF_INET6,
2180 SOCK_RAW, IPPROTO_TCP, net); 2191 SOCK_RAW, IPPROTO_TCP, net);
2181} 2192}
2182 2193
2183static void tcpv6_net_exit(struct net *net) 2194static void __net_exit tcpv6_net_exit(struct net *net)
2184{ 2195{
2185 inet_ctl_sock_destroy(net->ipv6.tcp_sk); 2196 inet_ctl_sock_destroy(net->ipv6.tcp_sk);
2186} 2197}
2187 2198
2188static void tcpv6_net_exit_batch(struct list_head *net_exit_list) 2199static void __net_exit tcpv6_net_exit_batch(struct list_head *net_exit_list)
2189{ 2200{
2190 inet_twsk_purge(&tcp_hashinfo, &tcp_death_row, AF_INET6); 2201 inet_twsk_purge(&tcp_hashinfo, &tcp_death_row, AF_INET6);
2191} 2202}