Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Move call to sofree() to end of sctp_inpcb_free(...



details:   https://anonhg.NetBSD.org/src/rev/96d3ce3a6d56
branches:  trunk
changeset: 827166:96d3ce3a6d56
user:      rjs <rjs%NetBSD.org@localhost>
date:      Tue Oct 17 19:18:30 2017 +0000

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

Logic copied from in_pcb.c.

diffstat:

 sys/netinet/sctp_pcb.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 4ccb4b7f0525 -r 96d3ce3a6d56 sys/netinet/sctp_pcb.c
--- a/sys/netinet/sctp_pcb.c    Tue Oct 17 18:52:50 2017 +0000
+++ b/sys/netinet/sctp_pcb.c    Tue Oct 17 19:18:30 2017 +0000
@@ -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 @@
                ipsec4_delete_pcbpolicy(ip_pcb);
 #endif /*IPSEC*/
                so->so_pcb = 0;
-               sofree(so);
        }
 
        if (ip_pcb->inp_options) {
@@ -2258,6 +2257,9 @@
 
        SCTP_INP_INFO_WUNLOCK();
        splx(s);
+
+       sofree(so);
+       mutex_enter(softnet_lock);
 }
 
 



Home | Main Index | Thread Index | Old Index