diff options
author | Michael Tuexen <tuexen@fh-muenster.de> | 2020-03-25 00:06:28 +0100 |
---|---|---|
committer | Michael Tuexen <tuexen@fh-muenster.de> | 2020-03-25 00:06:28 +0100 |
commit | 340942be471c2a1e45a183b39c0948022f69018b (patch) | |
tree | 5d49b32aa2174e39b909bd0183148b31f29798a0 /usrsctplib | |
parent | a4e2dd8e20ad3098463710a9e7a5343af7c853c5 (diff) | |
download | usrsctp-340942be471c2a1e45a183b39c0948022f69018b.tar.gz |
Only call panic() when building with INVARIANTS.
Diffstat (limited to 'usrsctplib')
-rwxr-xr-x | usrsctplib/netinet/sctputil.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usrsctplib/netinet/sctputil.c b/usrsctplib/netinet/sctputil.c index 3073e9f6..ab95fad9 100755 --- a/usrsctplib/netinet/sctputil.c +++ b/usrsctplib/netinet/sctputil.c @@ -34,7 +34,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 359287 2020-03-24 22:44:36Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 359288 2020-03-24 23:04:07Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -2114,7 +2114,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); @@ -2545,7 +2549,11 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, 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)); @@ -2828,7 +2836,11 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, 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) && |