On Sat, Apr 15, 2000 at 08:51:30PM +0400, A.N.Kuznetsov wrote:
> Hello!
>
> > Yes, it should:
>
> But what will occur when syn_recv_sock returns NULL?
The slow timer freeing the request decreases it. But of course syncookies
does not explicitely start it, so it could be around for a long time
on a idle socket until it was hit by chance. Also the timer counter would
get decreased one too much, doh.
Maybe it would be really best to kill this buggy peace of code and replace
it with backlog RED (which would fit much better in the normal framework)
This one does it better:
--- linux/net/ipv4/syncookies.c-o Wed Feb 9 14:26:11 2000
+++ linux/net/ipv4/syncookies.c Sat Apr 15 19:31:07 2000
@@ -104,9 +104,20 @@
{
struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
+ sk->tp_pinfo.af_tcp.syn_backlog++;
+
sk = tp->af_specific->syn_recv_sock(sk, skb, req, dst);
+
+ if (!sk) {
+ --sk->tp_pinfo.af_tcp.syn_backlog;
+ if (req->af.v4_req.opt)
+ kfree(req->af.v4_req.opt);
+ tcp_openreq_free(req);
+ return NULL;
+ }
+
req->sk = sk;
-
+
/* Queue up for accept() */
tcp_synq_queue(tp, req);
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]