aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_timewait_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
-rw-r--r--net/ipv4/inet_timewait_sock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 717c411a5c6b..ce16e9ac24c1 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -57,6 +57,7 @@ void inet_twsk_put(struct inet_timewait_sock *tw)
57 printk(KERN_DEBUG "%s timewait_sock %p released\n", 57 printk(KERN_DEBUG "%s timewait_sock %p released\n",
58 tw->tw_prot->name, tw); 58 tw->tw_prot->name, tw);
59#endif 59#endif
60 release_net(twsk_net(tw));
60 kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw); 61 kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw);
61 module_put(owner); 62 module_put(owner);
62 } 63 }
@@ -91,7 +92,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
91 92
92 /* Step 2: Remove SK from established hash. */ 93 /* Step 2: Remove SK from established hash. */
93 if (__sk_del_node_init(sk)) 94 if (__sk_del_node_init(sk))
94 sock_prot_inuse_add(sk->sk_prot, -1); 95 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
95 96
96 /* Step 3: Hash TW into TIMEWAIT chain. */ 97 /* Step 3: Hash TW into TIMEWAIT chain. */
97 inet_twsk_add_node(tw, &ehead->twchain); 98 inet_twsk_add_node(tw, &ehead->twchain);
@@ -124,7 +125,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat
124 tw->tw_hash = sk->sk_hash; 125 tw->tw_hash = sk->sk_hash;
125 tw->tw_ipv6only = 0; 126 tw->tw_ipv6only = 0;
126 tw->tw_prot = sk->sk_prot_creator; 127 tw->tw_prot = sk->sk_prot_creator;
127 tw->tw_net = sk->sk_net; 128 twsk_net_set(tw, hold_net(sock_net(sk)));
128 atomic_set(&tw->tw_refcnt, 1); 129 atomic_set(&tw->tw_refcnt, 1);
129 inet_twsk_dead_node_init(tw); 130 inet_twsk_dead_node_init(tw);
130 __module_get(tw->tw_prot->owner); 131 __module_get(tw->tw_prot->owner);