svn commit: r364565 - stable/12/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sun Aug 23 22:09:21 UTC 2020


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) &&


More information about the svn-src-all mailing list