aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 22:33:31 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:32:11 -0400
commit83e3609eba3818f6e18b8bf9442195169ac306b7 (patch)
treeb0dd71b7e5ea6e8b17813cf6b3736a1b0f443ab7 /net/ipv4/tcp.c
parent080774a243f56ce2195ace96fba3d18548ee48ce (diff)
[REQSK]: Move the syn_table destroy from tcp_listen_stop to reqsk_queue_destroy
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index d2696af46c70..42a2e2ccd430 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -487,7 +487,7 @@ int tcp_listen_start(struct sock *sk)
487 } 487 }
488 488
489 sk->sk_state = TCP_CLOSE; 489 sk->sk_state = TCP_CLOSE;
490 reqsk_queue_destroy(&tp->accept_queue); 490 __reqsk_queue_destroy(&tp->accept_queue);
491 return -EADDRINUSE; 491 return -EADDRINUSE;
492} 492}
493 493
@@ -499,38 +499,23 @@ int tcp_listen_start(struct sock *sk)
499static void tcp_listen_stop (struct sock *sk) 499static void tcp_listen_stop (struct sock *sk)
500{ 500{
501 struct tcp_sock *tp = tcp_sk(sk); 501 struct tcp_sock *tp = tcp_sk(sk);
502 struct listen_sock *lopt;
503 struct request_sock *acc_req; 502 struct request_sock *acc_req;
504 struct request_sock *req; 503 struct request_sock *req;
505 int i;
506 504
507 tcp_delete_keepalive_timer(sk); 505 tcp_delete_keepalive_timer(sk);
508 506
509 /* make all the listen_opt local to us */ 507 /* make all the listen_opt local to us */
510 lopt = reqsk_queue_yank_listen_sk(&tp->accept_queue);
511 acc_req = reqsk_queue_yank_acceptq(&tp->accept_queue); 508 acc_req = reqsk_queue_yank_acceptq(&tp->accept_queue);
512 509
513 if (lopt->qlen) { 510 /* Following specs, it would be better either to send FIN
514 for (i = 0; i < TCP_SYNQ_HSIZE; i++) { 511 * (and enter FIN-WAIT-1, it is normal close)
515 while ((req = lopt->syn_table[i]) != NULL) { 512 * or to send active reset (abort).
516 lopt->syn_table[i] = req->dl_next; 513 * Certainly, it is pretty dangerous while synflood, but it is
517 lopt->qlen--; 514 * bad justification for our negligence 8)
518 reqsk_free(req); 515 * To be honest, we are not able to make either
519 516 * of the variants now. --ANK
520 /* Following specs, it would be better either to send FIN 517 */
521 * (and enter FIN-WAIT-1, it is normal close) 518 reqsk_queue_destroy(&tp->accept_queue);
522 * or to send active reset (abort).
523 * Certainly, it is pretty dangerous while synflood, but it is
524 * bad justification for our negligence 8)
525 * To be honest, we are not able to make either
526 * of the variants now. --ANK
527 */
528 }
529 }
530 }
531 BUG_TRAP(!lopt->qlen);
532
533 kfree(lopt);
534 519
535 while ((req = acc_req) != NULL) { 520 while ((req = acc_req) != NULL) {
536 struct sock *child = req->sk; 521 struct sock *child = req->sk;