Author: tuexen
Date: Wed Mar 25 13:18:37 2020
New Revision: 359300
URL: https://svnweb.freebsd.org/changeset/base/359300

Log:
  Don't restore the vnet too early in error cases.
  
  MFC after:            1 week

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c Wed Mar 25 10:11:37 2020        (r359299)
+++ head/sys/netinet/sctputil.c Wed Mar 25 13:18:37 2020        (r359300)
@@ -1673,10 +1673,10 @@ sctp_timeout_handler(void *t)
                    (type != SCTP_TIMER_TYPE_SHUTDOWNGUARD) &&
                    (type != SCTP_TIMER_TYPE_ASOCKILL))) {
                        SCTP_INP_DECR_REF(inp);
-                       CURVNET_RESTORE();
                        SCTPDBG(SCTP_DEBUG_TIMER2,
                            "Timer type = %d handler exiting due to closed 
socket\n",
                            type);
+                       CURVNET_RESTORE();
                        return;
                }
        }
@@ -1688,10 +1688,10 @@ sctp_timeout_handler(void *t)
                        if (inp) {
                                SCTP_INP_DECR_REF(inp);
                        }
-                       CURVNET_RESTORE();
                        SCTPDBG(SCTP_DEBUG_TIMER2,
                            "Timer type = %d handler exiting due to CLOSED 
association\n",
                            type);
+                       CURVNET_RESTORE();
                        return;
                }
        }
@@ -1704,10 +1704,10 @@ sctp_timeout_handler(void *t)
                if (stcb) {
                        atomic_add_int(&stcb->asoc.refcnt, -1);
                }
-               CURVNET_RESTORE();
                SCTPDBG(SCTP_DEBUG_TIMER2,
                    "Timer type = %d handler exiting due to not being active\n",
                    type);
+               CURVNET_RESTORE();
                return;
        }
        tmr->stopped_from = 0xa004;
@@ -1722,10 +1722,10 @@ sctp_timeout_handler(void *t)
                        if (inp) {
                                SCTP_INP_DECR_REF(inp);
                        }
-                       CURVNET_RESTORE();
                        SCTPDBG(SCTP_DEBUG_TIMER2,
                            "Timer type = %d handler exiting due to CLOSED 
association\n",
                            type);
+                       CURVNET_RESTORE();
                        return;
                }
        } else if (inp != NULL) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to