Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Since callers of m_getcl() assume it always all...



details:   https://anonhg.NetBSD.org/src/rev/3038fba122a5
branches:  trunk
changeset: 557713:3038fba122a5
user:      scw <scw%NetBSD.org@localhost>
date:      Fri Jan 16 09:50:40 2004 +0000

description:
Since callers of m_getcl() assume it always allocates a cluster, check
that MGETCL() actually succeeded before returning the mbuf.

diffstat:

 sys/netipsec/ipsec_osdep.h |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 744c6011368c -r 3038fba122a5 sys/netipsec/ipsec_osdep.h
--- a/sys/netipsec/ipsec_osdep.h        Fri Jan 16 09:10:10 2004 +0000
+++ b/sys/netipsec/ipsec_osdep.h        Fri Jan 16 09:50:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec_osdep.h,v 1.4 2003/11/11 20:25:26 jonathan Exp $ */
+/*     $NetBSD: ipsec_osdep.h,v 1.5 2004/01/16 09:50:40 scw Exp $      */
 
 #ifndef NETIPSEC_OSDEP_H
 #define NETIPSEC_OSDEP_H
@@ -118,6 +118,10 @@
                return NULL;
 
        MCLGET(mp, how);
+       if ((mp->m_flags & M_EXT) == 0) {
+               m_free(mp);
+               mp = NULL;
+       }
        return mp;
 }
 #endif /* __NetBSD__ */



Home | Main Index | Thread Index | Old Index