patch-2.2.16 linux/net/ipv4/syncookies.c

Next file: linux/net/ipv4/sysctl_net_ipv4.c
Previous file: linux/net/ipv4/proc.c
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/net/ipv4/syncookies.c linux/net/ipv4/syncookies.c
@@ -9,7 +9,7 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  * 
- *  $Id: syncookies.c,v 1.7.2.3 1999/12/07 03:11:07 davem Exp $
+ *  $Id: syncookies.c,v 1.7.2.4 2000/04/17 05:57:01 davem Exp $
  *
  *  Missing: IPv6 support. 
  */
@@ -104,11 +104,19 @@
 {
 	struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
 
+	tp->syn_backlog++;
+
 	sk = tp->af_specific->syn_recv_sock(sk, skb, req, dst);
-	req->sk = sk; 
-	
-	/* Queue up for accept() */
-	tcp_synq_queue(tp, req);
+	if (sk) {
+		req->sk = sk; 
+
+		/* Queue up for accept() */
+		tcp_synq_queue(tp, req);
+	} else {
+		tp->syn_backlog--;
+		(*req->class->destructor)(req);
+		tcp_openreq_free(req); 
+	}
 	
 	return sk; 
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)