Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet fix ipqent pool corruption problems. make tcp r...



details:   https://anonhg.NetBSD.org/src/rev/f133252cf722
branches:  trunk
changeset: 569982:f133252cf722
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Sep 15 09:21:22 2004 +0000

description:
fix ipqent pool corruption problems.  make tcp reass code use
its own pool of ipqent rather than sharing it with ip reass code.
PR/24782.

diffstat:

 sys/netinet/tcp_input.c |  16 +++++++++-------
 sys/netinet/tcp_subr.c  |   6 +++---
 sys/netinet/tcp_var.h   |   4 +++-
 3 files changed, 15 insertions(+), 11 deletions(-)

diffs (117 lines):

diff -r efcb09686fe3 -r f133252cf722 sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Wed Sep 15 09:10:42 2004 +0000
+++ b/sys/netinet/tcp_input.c   Wed Sep 15 09:21:22 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.208 2004/06/26 03:29:15 itojun Exp $   */
+/*     $NetBSD: tcp_input.c,v 1.209 2004/09/15 09:21:22 yamt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.208 2004/06/26 03:29:15 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.209 2004/09/15 09:21:22 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -347,6 +347,8 @@
 
 #define        TRAVERSE(x) while ((x)->m_next) (x) = (x)->m_next
 
+POOL_INIT(tcpipqent_pool, sizeof(struct ipqent), 0, 0, 0, "tcpipqepl", NULL);
+
 int
 tcp_reass(tp, th, m, tlen)
        struct tcpcb *tp;
@@ -498,7 +500,7 @@
                        tcpstat.tcps_rcvdupbyte += pkt_len;
                        m_freem(m);
                        if (tiqe != NULL)
-                               pool_put(&ipqent_pool, tiqe);
+                               pool_put(&tcpipqent_pool, tiqe);
                        TCP_REASS_COUNTER_INCR(&tcp_reass_segdup);
                        return (0);
                }
@@ -578,7 +580,7 @@
                        if (tiqe == NULL)
                                tiqe = q;
                        else
-                               pool_put(&ipqent_pool, q);
+                               pool_put(&tcpipqent_pool, q);
                        TCP_REASS_COUNTER_INCR(&tcp_reass_prepend);
                        break;
                }
@@ -603,7 +605,7 @@
                if (tiqe == NULL)
                        tiqe = q;
                else
-                       pool_put(&ipqent_pool, q);
+                       pool_put(&tcpipqent_pool, q);
        }
 
 #ifdef TCP_REASS_COUNTERS
@@ -623,7 +625,7 @@
         * XXX If we can't, just drop the packet.  XXX
         */
        if (tiqe == NULL) {
-               tiqe = pool_get(&ipqent_pool, PR_NOWAIT);
+               tiqe = pool_get(&tcpipqent_pool, PR_NOWAIT);
                if (tiqe == NULL) {
                        tcpstat.tcps_rcvmemdrop++;
                        m_freem(m);
@@ -692,7 +694,7 @@
                m_freem(q->ipqe_m);
        else
                sbappendstream(&so->so_rcv, q->ipqe_m);
-       pool_put(&ipqent_pool, q);
+       pool_put(&tcpipqent_pool, q);
        sorwakeup(so);
        return (pkt_flags);
 }
diff -r efcb09686fe3 -r f133252cf722 sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c    Wed Sep 15 09:10:42 2004 +0000
+++ b/sys/netinet/tcp_subr.c    Wed Sep 15 09:21:22 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_subr.c,v 1.172 2004/05/18 14:44:14 itojun Exp $    */
+/*     $NetBSD: tcp_subr.c,v 1.173 2004/09/15 09:21:22 yamt Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.172 2004/05/18 14:44:14 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.173 2004/09/15 09:21:22 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1244,7 +1244,7 @@
                TAILQ_REMOVE(&tp->segq, qe, ipqe_q);
                TAILQ_REMOVE(&tp->timeq, qe, ipqe_timeq);
                m_freem(qe->ipqe_m);
-               pool_put(&ipqent_pool, qe);
+               pool_put(&tcpipqent_pool, qe);
                rv = 1;
        }
        return (rv);
diff -r efcb09686fe3 -r f133252cf722 sys/netinet/tcp_var.h
--- a/sys/netinet/tcp_var.h     Wed Sep 15 09:10:42 2004 +0000
+++ b/sys/netinet/tcp_var.h     Wed Sep 15 09:21:22 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_var.h,v 1.112 2004/05/18 14:44:16 itojun Exp $     */
+/*     $NetBSD: tcp_var.h,v 1.113 2004/09/15 09:21:22 yamt Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -684,6 +684,8 @@
 extern struct syn_cache_head tcp_syn_cache[];
 extern u_long syn_cache_count;
 
+extern struct pool tcpipqent_pool;
+
 #ifdef MBUFTRACE
 extern struct mowner tcp_rx_mowner;
 extern struct mowner tcp_tx_mowner;



Home | Main Index | Thread Index | Old Index