summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/inet_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/inet/inet_common.c')
-rw-r--r--usr/src/uts/common/inet/inet_common.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr/src/uts/common/inet/inet_common.c b/usr/src/uts/common/inet/inet_common.c
index 0900852a64..e55abc6c01 100644
--- a/usr/src/uts/common/inet/inet_common.c
+++ b/usr/src/uts/common/inet/inet_common.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -103,3 +103,21 @@ inet_minor_free(void *a, dev_t dev)
ASSERT((dev != OPENFAIL) && (dev != 0) && (dev <= inet_maxminor));
vmem_free(((inet_arena_t *)a)->ineta_arena, (void *)dev, 1);
}
+
+/*
+ * This function is used to free a message that has gone through
+ * mi_copyin processing which modifies the M_IOCTL mblk's b_next
+ * and b_prev pointers. We use this function to set b_next/b_prev
+ * to NULL and free them.
+ */
+void
+inet_freemsg(mblk_t *mp)
+{
+ mblk_t *bp = mp;
+
+ for (; bp != NULL; bp = bp->b_cont) {
+ bp->b_prev = NULL;
+ bp->b_next = NULL;
+ }
+ freemsg(mp);
+}