Module Name:    src
Committed By:   rjs
Date:           Tue Oct 17 19:18:30 UTC 2017

Modified Files:
        src/sys/netinet: sctp_pcb.c

Log Message:
Move call to sofree() to end of sctp_inpcb_free() and re-aquire
softnet_lock.

Logic copied from in_pcb.c.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet/sctp_pcb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/sctp_pcb.c
diff -u src/sys/netinet/sctp_pcb.c:1.13 src/sys/netinet/sctp_pcb.c:1.14
--- src/sys/netinet/sctp_pcb.c:1.13	Tue Oct 17 15:53:01 2017
+++ src/sys/netinet/sctp_pcb.c	Tue Oct 17 19:18:30 2017
@@ -1,5 +1,5 @@
 /* $KAME: sctp_pcb.c,v 1.39 2005/06/16 18:29:25 jinmei Exp $ */
-/* $NetBSD: sctp_pcb.c,v 1.13 2017/10/17 15:53:01 rjs Exp $ */
+/* $NetBSD: sctp_pcb.c,v 1.14 2017/10/17 19:18:30 rjs Exp $ */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp_pcb.c,v 1.13 2017/10/17 15:53:01 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_pcb.c,v 1.14 2017/10/17 19:18:30 rjs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2142,7 +2142,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, 
 		ipsec4_delete_pcbpolicy(ip_pcb);
 #endif /*IPSEC*/
 		so->so_pcb = 0;
-		sofree(so);
 	}
 
 	if (ip_pcb->inp_options) {
@@ -2258,6 +2257,9 @@ sctp_inpcb_free(struct sctp_inpcb *inp, 
 
 	SCTP_INP_INFO_WUNLOCK();
 	splx(s);
+
+	sofree(so);
+	mutex_enter(softnet_lock);
 }
 
 

Reply via email to