diff options
author | tuexen <tuexen@FreeBSD.org> | 2010-09-15 21:53:10 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2010-09-15 21:53:10 +0000 |
commit | 989dcde2a6d367ac9159492566c30f0d0f398152 (patch) | |
tree | 03577cfa112dd480b80c9a00562f25b51e005bbe /sys | |
parent | efe139f42862547189aa3fe5ef32e858c1ecf200 (diff) | |
download | FreeBSD-src-989dcde2a6d367ac9159492566c30f0d0f398152.zip FreeBSD-src-989dcde2a6d367ac9159492566c30f0d0f398152.tar.gz |
Use TAILQ_EMPTY() for testing if a tail queue is empty.
Set whoFrom to NULL after freeing whoFrom.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/sctp_indata.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 12fba8b..6095fe5 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -708,9 +708,10 @@ protocol_error: control->data = NULL; asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); - if (control->whoFrom) + if (control->whoFrom) { sctp_free_remote_addr(control->whoFrom); - control->whoFrom = NULL; + control->whoFrom = NULL; + } sctp_free_a_readq(stcb, control); return; } else { @@ -4845,7 +4846,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, if (asoc->pr_sctp_cnt != 0) asoc->pr_sctp_cnt--; } - if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) && + if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { #ifdef INVARIANTS panic("Warning flight size is postive and should be 0"); @@ -5818,7 +5819,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, */ sctp_slide_mapping_arrays(stcb); - if (TAILQ_FIRST(&asoc->reasmqueue)) { + if (!TAILQ_EMPTY(&asoc->reasmqueue)) { /* now lets kick out and check for more fragmented delivery */ /* sa_ignore NO_NULL_CHK */ sctp_deliver_reasm_check(stcb, &stcb->asoc); |