blob: 13f0781f35cda6668a09d35245e3e2777de83697 [file] [log] [blame]
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -07001/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic TIME_WAIT sockets functions
7 *
8 * From code orinally in TCP
9 */
10
Ilpo Järvinen172589c2007-08-28 15:50:33 -070011#include <linux/kernel.h>
Vegard Nossum9e337b02008-10-18 17:37:51 +020012#include <linux/kmemcheck.h>
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070013#include <net/inet_hashtables.h>
14#include <net/inet_timewait_sock.h>
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -070015#include <net/ip.h>
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070016
17/* Must be called with locally disabled BHs. */
Adrian Bunkacd159b2007-07-14 19:00:59 -070018static void __inet_twsk_kill(struct inet_timewait_sock *tw,
19 struct inet_hashinfo *hashinfo)
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070020{
21 struct inet_bind_hashbucket *bhead;
22 struct inet_bind_bucket *tb;
23 /* Unlink from established hashes. */
Eric Dumazet9db66bd2008-11-20 20:39:09 -080024 spinlock_t *lock = inet_ehash_lockp(hashinfo, tw->tw_hash);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070025
Eric Dumazet9db66bd2008-11-20 20:39:09 -080026 spin_lock(lock);
Eric Dumazet3ab5aee2008-11-16 19:40:17 -080027 if (hlist_nulls_unhashed(&tw->tw_node)) {
Eric Dumazet9db66bd2008-11-20 20:39:09 -080028 spin_unlock(lock);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070029 return;
30 }
Eric Dumazet3ab5aee2008-11-16 19:40:17 -080031 hlist_nulls_del_rcu(&tw->tw_node);
32 sk_nulls_node_init(&tw->tw_node);
Eric Dumazet9db66bd2008-11-20 20:39:09 -080033 spin_unlock(lock);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070034
35 /* Disassociate with bind bucket. */
Pavel Emelyanov7f635ab2008-06-16 17:12:49 -070036 bhead = &hashinfo->bhash[inet_bhashfn(twsk_net(tw), tw->tw_num,
37 hashinfo->bhash_size)];
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070038 spin_lock(&bhead->lock);
39 tb = tw->tw_tb;
40 __hlist_del(&tw->tw_bind_node);
41 tw->tw_tb = NULL;
42 inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb);
43 spin_unlock(&bhead->lock);
44#ifdef SOCK_REFCNT_DEBUG
45 if (atomic_read(&tw->tw_refcnt) != 1) {
46 printk(KERN_DEBUG "%s timewait_sock %p refcnt=%d\n",
47 tw->tw_prot->name, tw, atomic_read(&tw->tw_refcnt));
48 }
49#endif
50 inet_twsk_put(tw);
51}
52
Arnaldo Carvalho de Melo4dbc8ef2009-05-06 16:50:52 -070053static noinline void inet_twsk_free(struct inet_timewait_sock *tw)
54{
55 struct module *owner = tw->tw_prot->owner;
56 twsk_destructor((struct sock *)tw);
57#ifdef SOCK_REFCNT_DEBUG
58 pr_debug("%s timewait_sock %p released\n", tw->tw_prot->name, tw);
59#endif
60 release_net(twsk_net(tw));
61 kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw);
62 module_put(owner);
63}
64
Pavel Emelyanov7054fb92007-12-20 15:32:54 -080065void inet_twsk_put(struct inet_timewait_sock *tw)
66{
Arnaldo Carvalho de Melo4dbc8ef2009-05-06 16:50:52 -070067 if (atomic_dec_and_test(&tw->tw_refcnt))
68 inet_twsk_free(tw);
Pavel Emelyanov7054fb92007-12-20 15:32:54 -080069}
70EXPORT_SYMBOL_GPL(inet_twsk_put);
71
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070072/*
73 * Enter the time wait state. This is called with locally disabled BH.
74 * Essentially we whip up a timewait bucket, copy the relevant info into it
75 * from the SK, and mess with hash chains and list linkage.
76 */
77void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
78 struct inet_hashinfo *hashinfo)
79{
80 const struct inet_sock *inet = inet_sk(sk);
Arnaldo Carvalho de Melo463c84b2005-08-09 20:10:42 -070081 const struct inet_connection_sock *icsk = inet_csk(sk);
Eric Dumazet81c3d542005-10-03 14:13:38 -070082 struct inet_ehash_bucket *ehead = inet_ehash_bucket(hashinfo, sk->sk_hash);
Eric Dumazet9db66bd2008-11-20 20:39:09 -080083 spinlock_t *lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070084 struct inet_bind_hashbucket *bhead;
85 /* Step 1: Put TW into bind hash. Original socket stays there too.
86 Note, that any socket with inet->num != 0 MUST be bound in
87 binding cache, even if it is closed.
88 */
Pavel Emelyanov7f635ab2008-06-16 17:12:49 -070089 bhead = &hashinfo->bhash[inet_bhashfn(twsk_net(tw), inet->num,
90 hashinfo->bhash_size)];
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070091 spin_lock(&bhead->lock);
Arnaldo Carvalho de Melo463c84b2005-08-09 20:10:42 -070092 tw->tw_tb = icsk->icsk_bind_hash;
Ilpo Järvinen547b7922008-07-25 21:43:18 -070093 WARN_ON(!icsk->icsk_bind_hash);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070094 inet_twsk_add_bind_node(tw, &tw->tw_tb->owners);
95 spin_unlock(&bhead->lock);
96
Eric Dumazet9db66bd2008-11-20 20:39:09 -080097 spin_lock(lock);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -070098
Eric Dumazet3ab5aee2008-11-16 19:40:17 -080099 /*
100 * Step 2: Hash TW into TIMEWAIT chain.
101 * Should be done before removing sk from established chain
102 * because readers are lockless and search established first.
103 */
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -0700104 atomic_inc(&tw->tw_refcnt);
Eric Dumazet3ab5aee2008-11-16 19:40:17 -0800105 inet_twsk_add_node_rcu(tw, &ehead->twchain);
106
107 /* Step 3: Remove SK from established hash. */
108 if (__sk_nulls_del_node_init_rcu(sk))
109 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -0700110
Eric Dumazet9db66bd2008-11-20 20:39:09 -0800111 spin_unlock(lock);
Arnaldo Carvalho de Meloe48c4142005-08-09 20:09:46 -0700112}
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700113
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700114EXPORT_SYMBOL_GPL(__inet_twsk_hashdance);
115
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700116struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state)
117{
Arnaldo Carvalho de Melo6d6ee432005-12-13 23:25:19 -0800118 struct inet_timewait_sock *tw =
119 kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab,
Christoph Lameter54e6ecb2006-12-06 20:33:16 -0800120 GFP_ATOMIC);
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700121 if (tw != NULL) {
122 const struct inet_sock *inet = inet_sk(sk);
123
Vegard Nossum9e337b02008-10-18 17:37:51 +0200124 kmemcheck_annotate_bitfield(tw, flags);
125
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700126 /* Give us an identity. */
127 tw->tw_daddr = inet->daddr;
128 tw->tw_rcv_saddr = inet->rcv_saddr;
129 tw->tw_bound_dev_if = sk->sk_bound_dev_if;
130 tw->tw_num = inet->num;
131 tw->tw_state = TCP_TIME_WAIT;
132 tw->tw_substate = state;
133 tw->tw_sport = inet->sport;
134 tw->tw_dport = inet->dport;
135 tw->tw_family = sk->sk_family;
136 tw->tw_reuse = sk->sk_reuse;
Eric Dumazet81c3d542005-10-03 14:13:38 -0700137 tw->tw_hash = sk->sk_hash;
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700138 tw->tw_ipv6only = 0;
KOVACS Krisztianf5715ae2008-10-01 07:30:02 -0700139 tw->tw_transparent = inet->transparent;
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700140 tw->tw_prot = sk->sk_prot_creator;
Denis V. Lunevcd5342d2008-04-16 02:00:28 -0700141 twsk_net_set(tw, hold_net(sock_net(sk)));
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700142 atomic_set(&tw->tw_refcnt, 1);
143 inet_twsk_dead_node_init(tw);
Arnaldo Carvalho de Meloeeb2b852005-10-10 21:25:23 -0700144 __module_get(tw->tw_prot->owner);
Arnaldo Carvalho de Meloc6762702005-08-09 20:09:59 -0700145 }
146
147 return tw;
148}
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700149
150EXPORT_SYMBOL_GPL(inet_twsk_alloc);
151
152/* Returns non-zero if quota exceeded. */
153static int inet_twdr_do_twkill_work(struct inet_timewait_death_row *twdr,
154 const int slot)
155{
156 struct inet_timewait_sock *tw;
157 struct hlist_node *node;
158 unsigned int killed;
159 int ret;
160
161 /* NOTE: compare this to previous version where lock
162 * was released after detaching chain. It was racy,
163 * because tw buckets are scheduled in not serialized context
164 * in 2.3 (with netfilter), and with softnet it is common, because
165 * soft irqs are not sequenced.
166 */
167 killed = 0;
168 ret = 0;
169rescan:
170 inet_twsk_for_each_inmate(tw, node, &twdr->cells[slot]) {
171 __inet_twsk_del_dead_node(tw);
172 spin_unlock(&twdr->death_lock);
173 __inet_twsk_kill(tw, twdr->hashinfo);
Pavel Emelyanovf2bf4152008-07-16 20:32:25 -0700174#ifdef CONFIG_NET_NS
175 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITED);
176#endif
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700177 inet_twsk_put(tw);
178 killed++;
179 spin_lock(&twdr->death_lock);
180 if (killed > INET_TWDR_TWKILL_QUOTA) {
181 ret = 1;
182 break;
183 }
184
185 /* While we dropped twdr->death_lock, another cpu may have
186 * killed off the next TW bucket in the list, therefore
187 * do a fresh re-read of the hlist head node with the
188 * lock reacquired. We still use the hlist traversal
189 * macro in order to get the prefetches.
190 */
191 goto rescan;
192 }
193
194 twdr->tw_count -= killed;
Pavel Emelyanovf2bf4152008-07-16 20:32:25 -0700195#ifndef CONFIG_NET_NS
196 NET_ADD_STATS_BH(&init_net, LINUX_MIB_TIMEWAITED, killed);
197#endif
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700198 return ret;
199}
200
201void inet_twdr_hangman(unsigned long data)
202{
203 struct inet_timewait_death_row *twdr;
204 int unsigned need_timer;
205
206 twdr = (struct inet_timewait_death_row *)data;
207 spin_lock(&twdr->death_lock);
208
209 if (twdr->tw_count == 0)
210 goto out;
211
212 need_timer = 0;
213 if (inet_twdr_do_twkill_work(twdr, twdr->slot)) {
214 twdr->thread_slots |= (1 << twdr->slot);
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700215 schedule_work(&twdr->twkill_work);
216 need_timer = 1;
217 } else {
218 /* We purged the entire slot, anything left? */
219 if (twdr->tw_count)
220 need_timer = 1;
Octavian Purdila80a10962009-08-29 00:00:35 -0700221 twdr->slot = ((twdr->slot + 1) & (INET_TWDR_TWKILL_SLOTS - 1));
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700222 }
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700223 if (need_timer)
224 mod_timer(&twdr->tw_timer, jiffies + twdr->period);
225out:
226 spin_unlock(&twdr->death_lock);
227}
228
229EXPORT_SYMBOL_GPL(inet_twdr_hangman);
230
David Howells65f27f32006-11-22 14:55:48 +0000231void inet_twdr_twkill_work(struct work_struct *work)
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700232{
David Howells65f27f32006-11-22 14:55:48 +0000233 struct inet_timewait_death_row *twdr =
234 container_of(work, struct inet_timewait_death_row, twkill_work);
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700235 int i;
236
Pavel Emelyanov95c93822007-12-11 02:12:36 -0800237 BUILD_BUG_ON((INET_TWDR_TWKILL_SLOTS - 1) >
238 (sizeof(twdr->thread_slots) * 8));
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700239
240 while (twdr->thread_slots) {
241 spin_lock_bh(&twdr->death_lock);
242 for (i = 0; i < INET_TWDR_TWKILL_SLOTS; i++) {
243 if (!(twdr->thread_slots & (1 << i)))
244 continue;
245
246 while (inet_twdr_do_twkill_work(twdr, i) != 0) {
247 if (need_resched()) {
248 spin_unlock_bh(&twdr->death_lock);
249 schedule();
250 spin_lock_bh(&twdr->death_lock);
251 }
252 }
253
254 twdr->thread_slots &= ~(1 << i);
255 }
256 spin_unlock_bh(&twdr->death_lock);
257 }
258}
259
260EXPORT_SYMBOL_GPL(inet_twdr_twkill_work);
261
262/* These are always called from BH context. See callers in
263 * tcp_input.c to verify this.
264 */
265
266/* This is for handling early-kills of TIME_WAIT sockets. */
267void inet_twsk_deschedule(struct inet_timewait_sock *tw,
268 struct inet_timewait_death_row *twdr)
269{
270 spin_lock(&twdr->death_lock);
271 if (inet_twsk_del_dead_node(tw)) {
272 inet_twsk_put(tw);
273 if (--twdr->tw_count == 0)
274 del_timer(&twdr->tw_timer);
275 }
276 spin_unlock(&twdr->death_lock);
277 __inet_twsk_kill(tw, twdr->hashinfo);
278}
279
280EXPORT_SYMBOL(inet_twsk_deschedule);
281
282void inet_twsk_schedule(struct inet_timewait_sock *tw,
283 struct inet_timewait_death_row *twdr,
284 const int timeo, const int timewait_len)
285{
286 struct hlist_head *list;
287 int slot;
288
289 /* timeout := RTO * 3.5
290 *
291 * 3.5 = 1+2+0.5 to wait for two retransmits.
292 *
293 * RATIONALE: if FIN arrived and we entered TIME-WAIT state,
294 * our ACK acking that FIN can be lost. If N subsequent retransmitted
295 * FINs (or previous seqments) are lost (probability of such event
296 * is p^(N+1), where p is probability to lose single packet and
297 * time to detect the loss is about RTO*(2^N - 1) with exponential
298 * backoff). Normal timewait length is calculated so, that we
299 * waited at least for one retransmitted FIN (maximal RTO is 120sec).
300 * [ BTW Linux. following BSD, violates this requirement waiting
301 * only for 60sec, we should wait at least for 240 secs.
302 * Well, 240 consumes too much of resources 8)
303 * ]
304 * This interval is not reduced to catch old duplicate and
305 * responces to our wandering segments living for two MSLs.
306 * However, if we use PAWS to detect
307 * old duplicates, we can reduce the interval to bounds required
308 * by RTO, rather than MSL. So, if peer understands PAWS, we
309 * kill tw bucket after 3.5*RTO (it is important that this number
310 * is greater than TS tick!) and detect old duplicates with help
311 * of PAWS.
312 */
313 slot = (timeo + (1 << INET_TWDR_RECYCLE_TICK) - 1) >> INET_TWDR_RECYCLE_TICK;
314
315 spin_lock(&twdr->death_lock);
316
317 /* Unlink it, if it was scheduled */
318 if (inet_twsk_del_dead_node(tw))
319 twdr->tw_count--;
320 else
321 atomic_inc(&tw->tw_refcnt);
322
323 if (slot >= INET_TWDR_RECYCLE_SLOTS) {
324 /* Schedule to slow timer */
325 if (timeo >= timewait_len) {
326 slot = INET_TWDR_TWKILL_SLOTS - 1;
327 } else {
Ilpo Järvinen172589c2007-08-28 15:50:33 -0700328 slot = DIV_ROUND_UP(timeo, twdr->period);
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700329 if (slot >= INET_TWDR_TWKILL_SLOTS)
330 slot = INET_TWDR_TWKILL_SLOTS - 1;
331 }
332 tw->tw_ttd = jiffies + timeo;
333 slot = (twdr->slot + slot) & (INET_TWDR_TWKILL_SLOTS - 1);
334 list = &twdr->cells[slot];
335 } else {
336 tw->tw_ttd = jiffies + (slot << INET_TWDR_RECYCLE_TICK);
337
338 if (twdr->twcal_hand < 0) {
339 twdr->twcal_hand = 0;
340 twdr->twcal_jiffie = jiffies;
341 twdr->twcal_timer.expires = twdr->twcal_jiffie +
342 (slot << INET_TWDR_RECYCLE_TICK);
343 add_timer(&twdr->twcal_timer);
344 } else {
345 if (time_after(twdr->twcal_timer.expires,
346 jiffies + (slot << INET_TWDR_RECYCLE_TICK)))
347 mod_timer(&twdr->twcal_timer,
348 jiffies + (slot << INET_TWDR_RECYCLE_TICK));
349 slot = (twdr->twcal_hand + slot) & (INET_TWDR_RECYCLE_SLOTS - 1);
350 }
351 list = &twdr->twcal_row[slot];
352 }
353
354 hlist_add_head(&tw->tw_death_node, list);
355
356 if (twdr->tw_count++ == 0)
357 mod_timer(&twdr->tw_timer, jiffies + twdr->period);
358 spin_unlock(&twdr->death_lock);
359}
360
361EXPORT_SYMBOL_GPL(inet_twsk_schedule);
362
363void inet_twdr_twcal_tick(unsigned long data)
364{
365 struct inet_timewait_death_row *twdr;
366 int n, slot;
367 unsigned long j;
368 unsigned long now = jiffies;
369 int killed = 0;
370 int adv = 0;
371
372 twdr = (struct inet_timewait_death_row *)data;
373
374 spin_lock(&twdr->death_lock);
375 if (twdr->twcal_hand < 0)
376 goto out;
377
378 slot = twdr->twcal_hand;
379 j = twdr->twcal_jiffie;
380
381 for (n = 0; n < INET_TWDR_RECYCLE_SLOTS; n++) {
382 if (time_before_eq(j, now)) {
383 struct hlist_node *node, *safe;
384 struct inet_timewait_sock *tw;
385
386 inet_twsk_for_each_inmate_safe(tw, node, safe,
387 &twdr->twcal_row[slot]) {
388 __inet_twsk_del_dead_node(tw);
389 __inet_twsk_kill(tw, twdr->hashinfo);
Pavel Emelyanovf2bf4152008-07-16 20:32:25 -0700390#ifdef CONFIG_NET_NS
391 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED);
392#endif
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700393 inet_twsk_put(tw);
394 killed++;
395 }
396 } else {
397 if (!adv) {
398 adv = 1;
399 twdr->twcal_jiffie = j;
400 twdr->twcal_hand = slot;
401 }
402
403 if (!hlist_empty(&twdr->twcal_row[slot])) {
404 mod_timer(&twdr->twcal_timer, j);
405 goto out;
406 }
407 }
408 j += 1 << INET_TWDR_RECYCLE_TICK;
409 slot = (slot + 1) & (INET_TWDR_RECYCLE_SLOTS - 1);
410 }
411 twdr->twcal_hand = -1;
412
413out:
414 if ((twdr->tw_count -= killed) == 0)
415 del_timer(&twdr->tw_timer);
Pavel Emelyanovf2bf4152008-07-16 20:32:25 -0700416#ifndef CONFIG_NET_NS
417 NET_ADD_STATS_BH(&init_net, LINUX_MIB_TIMEWAITKILLED, killed);
418#endif
Arnaldo Carvalho de Melo696ab2d2005-08-09 20:45:03 -0700419 spin_unlock(&twdr->death_lock);
420}
421
422EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick);
Daniel Lezcanod3154922008-09-08 13:17:27 -0700423
424void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo,
425 struct inet_timewait_death_row *twdr, int family)
426{
427 struct inet_timewait_sock *tw;
428 struct sock *sk;
Eric Dumazet3ab5aee2008-11-16 19:40:17 -0800429 struct hlist_nulls_node *node;
Daniel Lezcanod3154922008-09-08 13:17:27 -0700430 int h;
431
432 local_bh_disable();
433 for (h = 0; h < (hashinfo->ehash_size); h++) {
434 struct inet_ehash_bucket *head =
435 inet_ehash_bucket(hashinfo, h);
Eric Dumazet9db66bd2008-11-20 20:39:09 -0800436 spinlock_t *lock = inet_ehash_lockp(hashinfo, h);
Daniel Lezcanod3154922008-09-08 13:17:27 -0700437restart:
Eric Dumazet9db66bd2008-11-20 20:39:09 -0800438 spin_lock(lock);
Eric Dumazet3ab5aee2008-11-16 19:40:17 -0800439 sk_nulls_for_each(sk, node, &head->twchain) {
Daniel Lezcanod3154922008-09-08 13:17:27 -0700440
441 tw = inet_twsk(sk);
442 if (!net_eq(twsk_net(tw), net) ||
443 tw->tw_family != family)
444 continue;
445
446 atomic_inc(&tw->tw_refcnt);
Eric Dumazet9db66bd2008-11-20 20:39:09 -0800447 spin_unlock(lock);
Daniel Lezcanod3154922008-09-08 13:17:27 -0700448 inet_twsk_deschedule(tw, twdr);
449 inet_twsk_put(tw);
450
451 goto restart;
452 }
Eric Dumazet9db66bd2008-11-20 20:39:09 -0800453 spin_unlock(lock);
Daniel Lezcanod3154922008-09-08 13:17:27 -0700454 }
455 local_bh_enable();
456}
457EXPORT_SYMBOL_GPL(inet_twsk_purge);