o ipv4/ipv6: call tcp_timewait_kill in tcp_tw_deschedule

After all calls to tcp_tw_deschedule we had a call to tcp_timewait_kill,
move it to the end of tcp_tw_deschedule and unexport tcp_timewait_kill,
making it static.
parent 29b25594
......@@ -222,7 +222,6 @@ static inline void tcp_tw_put(struct tcp_tw_bucket *tw)
extern atomic_t tcp_orphan_count;
extern int tcp_tw_count;
extern void tcp_time_wait(struct sock *sk, int state, int timeo);
extern void tcp_timewait_kill(struct tcp_tw_bucket *tw);
extern void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo);
extern void tcp_tw_deschedule(struct tcp_tw_bucket *tw);
......
......@@ -633,7 +633,6 @@ static int __tcp_v4_check_established(struct sock *sk, __u16 lport,
} else if (tw) {
/* Silly. Should hash-dance instead... */
tcp_tw_deschedule(tw);
tcp_timewait_kill(tw);
NET_INC_STATS_BH(TimeWaitRecycled);
tcp_tw_put(tw);
......@@ -737,7 +736,6 @@ static int tcp_v4_hash_connect(struct sock *sk)
if (tw) {
tcp_tw_deschedule(tw);
tcp_timewait_kill(tw);
tcp_tw_put(tw);
}
......@@ -1853,7 +1851,6 @@ int tcp_v4_rcv(struct sk_buff *skb)
tcp_v4_iif(skb));
if (sk2) {
tcp_tw_deschedule((struct tcp_tw_bucket *)sk);
tcp_timewait_kill((struct tcp_tw_bucket *)sk);
tcp_tw_put((struct tcp_tw_bucket *)sk);
sk = sk2;
goto process;
......
......@@ -54,7 +54,7 @@ int tcp_tw_count;
/* Must be called with locally disabled BHs. */
void tcp_timewait_kill(struct tcp_tw_bucket *tw)
static void tcp_timewait_kill(struct tcp_tw_bucket *tw)
{
struct tcp_ehash_bucket *ehead;
struct tcp_bind_hashbucket *bhead;
......@@ -166,7 +166,6 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
if (!th->fin || TCP_SKB_CB(skb)->end_seq != tw->rcv_nxt+1) {
kill_with_rst:
tcp_tw_deschedule(tw);
tcp_timewait_kill(tw);
tcp_tw_put(tw);
return TCP_TW_RST;
}
......@@ -223,7 +222,6 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb,
if (sysctl_tcp_rfc1337 == 0) {
kill:
tcp_tw_deschedule(tw);
tcp_timewait_kill(tw);
tcp_tw_put(tw);
return TCP_TW_SUCCESS;
}
......@@ -484,6 +482,7 @@ void tcp_tw_deschedule(struct tcp_tw_bucket *tw)
del_timer(&tcp_tw_timer);
}
spin_unlock(&tw_death_lock);
tcp_timewait_kill(tw);
}
/* Short-time timewait calendar */
......
......@@ -505,7 +505,6 @@ static int tcp_v6_check_established(struct sock *sk)
/* Silly. Should hash-dance instead... */
local_bh_disable();
tcp_tw_deschedule(tw);
tcp_timewait_kill(tw);
NET_INC_STATS_BH(TimeWaitRecycled);
local_bh_enable();
......@@ -1698,7 +1697,6 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
sk2 = tcp_v6_lookup_listener(&skb->nh.ipv6h->daddr, ntohs(th->dest), tcp_v6_iif(skb));
if (sk2 != NULL) {
tcp_tw_deschedule((struct tcp_tw_bucket *)sk);
tcp_timewait_kill((struct tcp_tw_bucket *)sk);
tcp_tw_put((struct tcp_tw_bucket *)sk);
sk = sk2;
goto process;
......
......@@ -420,7 +420,6 @@ EXPORT_SYMBOL(tcp_statistics);
EXPORT_SYMBOL(tcp_rcv_state_process);
EXPORT_SYMBOL(tcp_timewait_state_process);
EXPORT_SYMBOL(tcp_timewait_cachep);
EXPORT_SYMBOL(tcp_timewait_kill);
EXPORT_SYMBOL(tcp_sendmsg);
EXPORT_SYMBOL(tcp_v4_rebuild_header);
EXPORT_SYMBOL(tcp_v4_send_check);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment