aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_minisocks.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index a51aa534dab1..65608863fdee 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -267,12 +267,9 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
267 const struct inet_connection_sock *icsk = inet_csk(sk); 267 const struct inet_connection_sock *icsk = inet_csk(sk);
268 const struct tcp_sock *tp = tcp_sk(sk); 268 const struct tcp_sock *tp = tcp_sk(sk);
269 bool recycle_ok = false; 269 bool recycle_ok = false;
270 bool recycle_on = false;
271 270
272 if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp) { 271 if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp)
273 recycle_ok = tcp_remember_stamp(sk); 272 recycle_ok = tcp_remember_stamp(sk);
274 recycle_on = true;
275 }
276 273
277 if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets) 274 if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets)
278 tw = inet_twsk_alloc(sk, state); 275 tw = inet_twsk_alloc(sk, state);
@@ -281,7 +278,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
281 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); 278 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
282 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); 279 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1);
283 struct inet_sock *inet = inet_sk(sk); 280 struct inet_sock *inet = inet_sk(sk);
284 struct inet_peer *peer = NULL;
285 281
286 tw->tw_transparent = inet->transparent; 282 tw->tw_transparent = inet->transparent;
287 tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale; 283 tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale;
@@ -305,12 +301,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
305 } 301 }
306#endif 302#endif
307 303
308 if (recycle_on)
309 peer = icsk->icsk_af_ops->get_peer(sk);
310 tcptw->tw_peer = peer;
311 if (peer)
312 atomic_inc(&peer->refcnt);
313
314#ifdef CONFIG_TCP_MD5SIG 304#ifdef CONFIG_TCP_MD5SIG
315 /* 305 /*
316 * The timewait bucket does not have the key DB from the 306 * The timewait bucket does not have the key DB from the
@@ -362,11 +352,9 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
362 352
363void tcp_twsk_destructor(struct sock *sk) 353void tcp_twsk_destructor(struct sock *sk)
364{ 354{
355#ifdef CONFIG_TCP_MD5SIG
365 struct tcp_timewait_sock *twsk = tcp_twsk(sk); 356 struct tcp_timewait_sock *twsk = tcp_twsk(sk);
366 357
367 if (twsk->tw_peer)
368 inet_putpeer(twsk->tw_peer);
369#ifdef CONFIG_TCP_MD5SIG
370 if (twsk->tw_md5_key) { 358 if (twsk->tw_md5_key) {
371 tcp_free_md5sig_pool(); 359 tcp_free_md5sig_pool();
372 kfree_rcu(twsk->tw_md5_key, rcu); 360 kfree_rcu(twsk->tw_md5_key, rcu);