summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-04-21 02:11:46 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 07:29:25 +0200
commit4ac02bab77438b484a5cf855a002fb6a1d592894 (patch)
tree8a7442a9c9fa39e147eca0f0728a0691712b191a /net/ipv4/tcp.c
parent[NET]: cleanup extra semicolons (diff)
downloadlinux-4ac02bab77438b484a5cf855a002fb6a1d592894.tar.xz
linux-4ac02bab77438b484a5cf855a002fb6a1d592894.zip
[TCP]: Uninline tcp_done().
The function is quite big and has several call sites and nothing to collapse by compiler optimization on inlining. Besides it's nicer to read in a in .c file. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4664733f139c..99ad52c00c96 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2375,6 +2375,23 @@ void __tcp_put_md5sig_pool(void)
EXPORT_SYMBOL(__tcp_put_md5sig_pool);
#endif
+void tcp_done(struct sock *sk)
+{
+ if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
+ TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
+
+ tcp_set_state(sk, TCP_CLOSE);
+ tcp_clear_xmit_timers(sk);
+
+ sk->sk_shutdown = SHUTDOWN_MASK;
+
+ if (!sock_flag(sk, SOCK_DEAD))
+ sk->sk_state_change(sk);
+ else
+ inet_csk_destroy_sock(sk);
+}
+EXPORT_SYMBOL_GPL(tcp_done);
+
extern void __skb_cb_too_small_for_tcp(int, int);
extern struct tcp_congestion_ops tcp_reno;