svn commit: r298199 - head/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Mon Apr 18 09:29:16 UTC 2016
Author: tuexen
Date: Mon Apr 18 09:29:14 2016
New Revision: 298199
URL: https://svnweb.freebsd.org/changeset/base/298199
Log:
Put panic() calls under INVARIANTS.
Modified:
head/sys/netinet/sctp_indata.c
head/sys/netinet/sctp_input.c
head/sys/netinet/sctputil.c
Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c Mon Apr 18 08:30:52 2016 (r298198)
+++ head/sys/netinet/sctp_indata.c Mon Apr 18 09:29:14 2016 (r298199)
@@ -570,9 +570,11 @@ protocol_error:
sctp_ucount_decr(asoc->cnt_on_all_streams);
if (control->on_strm_q == SCTP_ON_ORDERED) {
TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
+#ifdef INVARIANTS
} else {
panic("Huh control: %p is on_strm_q: %d",
control, control->on_strm_q);
+#endif
}
control->on_strm_q = 0;
strm->last_sequence_delivered++;
@@ -674,7 +676,11 @@ sctp_add_to_tail_pointer(struct sctp_que
stcb = control->stcb;
if (stcb == NULL) {
+#ifdef INVARIANTS
panic("Control broken");
+#else
+ return;
+#endif
}
if (control->tail_mbuf == NULL) {
/* TSNH */
@@ -1020,10 +1026,12 @@ sctp_deliver_reasm_check(struct sctp_tcb
if (control->end_added) {
/* We just put the last bit on */
if (control->on_strm_q) {
+#ifdef INVARIANTS
if (control->on_strm_q != SCTP_ON_UNORDERED) {
panic("Huh control: %p on_q: %d -- not unordered?",
control, control->on_strm_q);
}
+#endif
TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
control->on_strm_q = 0;
}
@@ -1072,10 +1080,12 @@ done_un:
strm->last_sequence_delivered);
if (control->end_added) {
if (control->on_strm_q) {
+#ifdef INVARIANTS
if (control->on_strm_q != SCTP_ON_ORDERED) {
panic("Huh control: %p on_q: %d -- not ordered?",
control, control->on_strm_q);
}
+#endif
TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
control->on_strm_q = 0;
}
@@ -1113,10 +1123,12 @@ deliver_more:
if (control->end_added) {
/* We are done with it afterwards */
if (control->on_strm_q) {
+#ifdef INVARIANTS
if (control->on_strm_q != SCTP_ON_ORDERED) {
panic("Huh control: %p on_q: %d -- not ordered?",
control, control->on_strm_q);
}
+#endif
TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
control->on_strm_q = 0;
}
@@ -1210,9 +1222,11 @@ sctp_add_chk_to_control(struct sctp_queu
/* Ordered */
TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
control->on_strm_q = 0;
+#ifdef INVARIANTS
} else if (control->on_strm_q) {
panic("Unknown state on ctrl: %p on_strm_q: %d", control,
control->on_strm_q);
+#endif
}
}
control->end_added = 1;
@@ -5167,9 +5181,11 @@ sctp_kick_prsctp_reorder_queue(struct sc
TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm);
} else if (ctl->on_strm_q == SCTP_ON_UNORDERED) {
TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm);
+#ifdef INVARIANTS
} else {
panic("strmin: %p ctl: %p unknown %d",
strmin, ctl, ctl->on_strm_q);
+#endif
}
ctl->on_strm_q = 0;
}
@@ -5230,9 +5246,11 @@ sctp_kick_prsctp_reorder_queue(struct sc
TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm);
} else if (ctl->on_strm_q == SCTP_ON_UNORDERED) {
TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm);
+#ifdef INVARIANTS
} else {
panic("strmin: %p ctl: %p unknown %d",
strmin, ctl, ctl->on_strm_q);
+#endif
}
ctl->on_strm_q = 0;
}
@@ -5493,9 +5511,11 @@ sctp_handle_forward_tsn(struct sctp_tcb
TAILQ_REMOVE(&strm->inqueue, ctl, next_instrm);
} else if (ctl->on_strm_q == SCTP_ON_UNORDERED) {
TAILQ_REMOVE(&strm->uno_inqueue, ctl, next_instrm);
+#ifdef INVARIANTS
} else if (ctl->on_strm_q) {
panic("strm: %p ctl: %p unknown %d",
strm, ctl, ctl->on_strm_q);
+#endif
}
ctl->on_strm_q = 0;
stcb->asoc.control_pdapi = ctl;
Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c Mon Apr 18 08:30:52 2016 (r298198)
+++ head/sys/netinet/sctp_input.c Mon Apr 18 09:29:14 2016 (r298199)
@@ -900,10 +900,12 @@ sctp_handle_shutdown(struct sctp_shutdow
/* Ordered */
TAILQ_REMOVE(&strm->inqueue, asoc->control_pdapi, next_instrm);
asoc->control_pdapi->on_strm_q = 0;
+#ifdef INVARIANTS
} else {
panic("Unknown state on ctrl:%p on_strm_q:%d",
asoc->control_pdapi,
asoc->control_pdapi->on_strm_q);
+#endif
}
}
asoc->control_pdapi->end_added = 1;
Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c Mon Apr 18 08:30:52 2016 (r298198)
+++ head/sys/netinet/sctputil.c Mon Apr 18 09:29:14 2016 (r298199)
@@ -5565,10 +5565,12 @@ restart_nosblocks:
sctp_m_free(control->aux_data);
control->aux_data = NULL;
}
+#ifdef INVARIANTS
if (control->on_strm_q) {
panic("About to free ctl:%p so:%p and its in %d",
control, so, control->on_strm_q);
}
+#endif
sctp_free_remote_addr(control->whoFrom);
sctp_free_a_readq(stcb, control);
if (hold_rlock) {
@@ -5976,10 +5978,12 @@ get_more_data:
no_rcv_needed = control->do_not_ref_stcb;
sctp_free_remote_addr(control->whoFrom);
control->data = NULL;
+#ifdef INVARIANTS
if (control->on_strm_q) {
panic("About to free ctl:%p so:%p and its in %d",
control, so, control->on_strm_q);
}
+#endif
sctp_free_a_readq(stcb, control);
control = NULL;
if ((freed_so_far >= rwnd_req) &&
More information about the svn-src-head
mailing list