Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Aug 2020 22:09:20 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364565 - stable/12/sys/netinet
Message-ID:  <202008232209.07NM9K5S086073@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun Aug 23 22:09:20 2020
New Revision: 364565
URL: https://svnweb.freebsd.org/changeset/base/364565

Log:
  MFC r359288:
  Only call panic when building with INVARIANTS.

Modified:
  stable/12/sys/netinet/sctputil.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctputil.c
==============================================================================
--- stable/12/sys/netinet/sctputil.c	Sun Aug 23 22:07:49 2020	(r364564)
+++ stable/12/sys/netinet/sctputil.c	Sun Aug 23 22:09:20 2020	(r364565)
@@ -2011,7 +2011,11 @@ sctp_timeout_handler(void *t)
 		sctp_delete_prim_timer(inp, stcb);
 		break;
 	default:
+#ifdef INVARIANTS
 		panic("Unknown timer type %d", type);
+#else
+		goto get_out;
+#endif
 	}
 #ifdef SCTP_AUDITING_ENABLED
 	sctp_audit_log(0xF1, (uint8_t)type);
@@ -2429,7 +2433,11 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, s
 		to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
 		break;
 	default:
+#ifdef INVARIANTS
 		panic("Unknown timer type %d", t_type);
+#else
+		return;
+#endif
 	}
 	KASSERT(tmr != NULL, ("tmr is NULL for timer type %d", t_type));
 	KASSERT(to_ticks > 0, ("to_ticks == 0 for timer type %d", t_type));
@@ -2710,7 +2718,11 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, st
 		tmr = &stcb->asoc.delete_prim_timer;
 		break;
 	default:
+#ifdef INVARIANTS
 		panic("Unknown timer type %d", t_type);
+#else
+		return;
+#endif
 	}
 	KASSERT(tmr != NULL, ("tmr is NULL for timer type %d", t_type));
 	if ((tmr->type != SCTP_TIMER_TYPE_NONE) &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008232209.07NM9K5S086073>