Author: tuexen
Date: Sat Apr  7 20:23:34 2018
New Revision: 332228
URL: https://svnweb.freebsd.org/changeset/base/332228

Log:
  MFC r326829:
  
  Cleaup, no functional change.

Modified:
  stable/11/sys/netinet/sctp_input.c
  stable/11/sys/netinet/sctp_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_input.c
==============================================================================
--- stable/11/sys/netinet/sctp_input.c  Sat Apr  7 20:22:04 2018        
(r332227)
+++ stable/11/sys/netinet/sctp_input.c  Sat Apr  7 20:23:34 2018        
(r332228)
@@ -3208,9 +3208,9 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct 
                        stcb->asoc.ecn_echo_cnt_onq--;
                        TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk,
                            sctp_next);
+                       stcb->asoc.ctrl_queue_cnt--;
                        sctp_m_freem(chk->data);
                        chk->data = NULL;
-                       stcb->asoc.ctrl_queue_cnt--;
                        sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
                        if (override == 0) {
                                break;
@@ -3642,26 +3642,23 @@ static void
 sctp_clean_up_stream_reset(struct sctp_tcb *stcb)
 {
        struct sctp_association *asoc;
-       struct sctp_tmit_chunk *chk = stcb->asoc.str_reset;
+       struct sctp_tmit_chunk *chk;
 
-       if (stcb->asoc.str_reset == NULL) {
+       asoc = &stcb->asoc;
+       chk = asoc->str_reset;
+       if (chk == NULL) {
                return;
        }
-       asoc = &stcb->asoc;
-
+       asoc->str_reset = NULL;
        sctp_timer_stop(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb,
            chk->whoTo, SCTP_FROM_SCTP_INPUT + SCTP_LOC_28);
-       TAILQ_REMOVE(&asoc->control_send_queue,
-           chk,
-           sctp_next);
+       TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
+       asoc->ctrl_queue_cnt--;
        if (chk->data) {
                sctp_m_freem(chk->data);
                chk->data = NULL;
        }
-       asoc->ctrl_queue_cnt--;
        sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
-       /* sa_ignore NO_NULL_CHK */
-       stcb->asoc.str_reset = NULL;
 }
 
 

Modified: stable/11/sys/netinet/sctp_output.c
==============================================================================
--- stable/11/sys/netinet/sctp_output.c Sat Apr  7 20:22:04 2018        
(r332227)
+++ stable/11/sys/netinet/sctp_output.c Sat Apr  7 20:23:34 2018        
(r332228)
@@ -6896,11 +6896,11 @@ sctp_toss_old_cookies(struct sctp_tcb *stcb, struct sc
        TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) {
                if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) {
                        TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
+                       asoc->ctrl_queue_cnt--;
                        if (chk->data) {
                                sctp_m_freem(chk->data);
                                chk->data = NULL;
                        }
-                       asoc->ctrl_queue_cnt--;
                        sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
                }
        }
@@ -6925,11 +6925,11 @@ sctp_toss_old_asconf(struct sctp_tcb *stcb)
                                }
                        }
                        TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next);
+                       asoc->ctrl_queue_cnt--;
                        if (chk->data) {
                                sctp_m_freem(chk->data);
                                chk->data = NULL;
                        }
-                       asoc->ctrl_queue_cnt--;
                        sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
                }
        }
@@ -7053,13 +7053,14 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_a
                        /* Stray chunks must be cleaned up */
        clean_up_anyway:
                        TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
+                       asoc->ctrl_queue_cnt--;
                        if (chk->data) {
                                sctp_m_freem(chk->data);
                                chk->data = NULL;
                        }
-                       asoc->ctrl_queue_cnt--;
-                       if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)
+                       if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) {
                                asoc->fwd_tsn_cnt--;
+                       }
                        sctp_free_a_chunk(stcb, chk, so_locked);
                } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) {
                        /* special handling, we must look into the param */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to