diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-10 06:27:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-11 01:40:09 -0400 |
commit | b6242b9b45e84ef71c59002cd128c3197938cb2f (patch) | |
tree | e8c33fc6eb1f0766002f9fca7b1729d505d32576 | |
parent | 81166dd6fa8eb780b2132d32fbc77eb6ac04e44e (diff) |
tcp: Remove tw->tw_peer
No longer used.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/tcp.h | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 16 |
2 files changed, 2 insertions, 15 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 7d3bcedc062a..2de9cf46f9fc 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -506,7 +506,6 @@ struct tcp_timewait_sock { | |||
506 | u32 tw_rcv_wnd; | 506 | u32 tw_rcv_wnd; |
507 | u32 tw_ts_recent; | 507 | u32 tw_ts_recent; |
508 | long tw_ts_recent_stamp; | 508 | long tw_ts_recent_stamp; |
509 | struct inet_peer *tw_peer; | ||
510 | #ifdef CONFIG_TCP_MD5SIG | 509 | #ifdef CONFIG_TCP_MD5SIG |
511 | struct tcp_md5sig_key *tw_md5_key; | 510 | struct tcp_md5sig_key *tw_md5_key; |
512 | #endif | 511 | #endif |
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 | ||
363 | void tcp_twsk_destructor(struct sock *sk) | 353 | void 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); |