Author: tuexen
Date: Tue Sep  3 19:31:59 2013
New Revision: 255190
URL: http://svnweb.freebsd.org/changeset/base/255190

Log:
  Remove redundant field pr_sctp_on.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_structs.h
  head/sys/netinet/sctp_timer.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c      Tue Sep  3 19:07:01 2013        
(r255189)
+++ head/sys/netinet/sctp_indata.c      Tue Sep  3 19:31:59 2013        
(r255190)
@@ -4718,7 +4718,7 @@ sctp_handle_sack(struct mbuf *m, int off
                        }
                }
                TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
-               if (tp1->pr_sctp_on) {
+               if (PR_SCTP_ENABLED(tp1->flags)) {
                        if (asoc->pr_sctp_cnt != 0)
                                asoc->pr_sctp_cnt--;
                }

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c      Tue Sep  3 19:07:01 2013        
(r255189)
+++ head/sys/netinet/sctp_output.c      Tue Sep  3 19:31:59 2013        
(r255190)
@@ -6067,7 +6067,6 @@ sctp_get_frag_point(struct sctp_tcb *stc
 static void
 sctp_set_prsctp_policy(struct sctp_stream_queue_pending *sp)
 {
-       sp->pr_sctp_on = 0;
        /*
         * We assume that the user wants PR_SCTP_TTL if the user provides a
         * positive lifetime but does not specify any PR_SCTP policy. This
@@ -6077,7 +6076,6 @@ sctp_set_prsctp_policy(struct sctp_strea
         */
        if (PR_SCTP_ENABLED(sp->sinfo_flags)) {
                sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags);
-               sp->pr_sctp_on = 1;
        } else {
                return;
        }
@@ -7425,13 +7423,8 @@ dont_do_it:
                }
                chk->send_size += pads;
        }
-       /* We only re-set the policy if it is on */
-       if (sp->pr_sctp_on) {
-               sctp_set_prsctp_policy(sp);
+       if (PR_SCTP_ENABLED(chk->flags)) {
                asoc->pr_sctp_cnt++;
-               chk->pr_sctp_on = 1;
-       } else {
-               chk->pr_sctp_on = 0;
        }
        if (sp->msg_is_complete && (sp->length == 0) && (sp->sender_all_done)) {
                /* All done pull and kill the message */

Modified: head/sys/netinet/sctp_structs.h
==============================================================================
--- head/sys/netinet/sctp_structs.h     Tue Sep  3 19:07:01 2013        
(r255189)
+++ head/sys/netinet/sctp_structs.h     Tue Sep  3 19:31:59 2013        
(r255190)
@@ -446,7 +446,6 @@ struct sctp_tmit_chunk {
        uint8_t do_rtt;
        uint8_t book_size_scale;
        uint8_t no_fr_allowed;
-       uint8_t pr_sctp_on;
        uint8_t copy_by_ref;
        uint8_t window_probe;
 };
@@ -522,7 +521,6 @@ struct sctp_stream_queue_pending {
        uint8_t holds_key_ref;
        uint8_t msg_is_complete;
        uint8_t some_taken;
-       uint8_t pr_sctp_on;
        uint8_t sender_all_done;
        uint8_t put_last_out;
        uint8_t discard_rest;

Modified: head/sys/netinet/sctp_timer.c
==============================================================================
--- head/sys/netinet/sctp_timer.c       Tue Sep  3 19:07:01 2013        
(r255189)
+++ head/sys/netinet/sctp_timer.c       Tue Sep  3 19:31:59 2013        
(r255190)
@@ -446,7 +446,7 @@ sctp_recover_sent_list(struct sctp_tcb *
                                }
                        }
                        TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
-                       if (chk->pr_sctp_on) {
+                       if (PR_SCTP_ENABLED(chk->flags)) {
                                if (asoc->pr_sctp_cnt != 0)
                                        asoc->pr_sctp_cnt--;
                        }

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c Tue Sep  3 19:07:01 2013        (r255189)
+++ head/sys/netinet/sctputil.c Tue Sep  3 19:31:59 2013        (r255190)
@@ -4833,7 +4833,6 @@ sctp_release_pr_sctp_chunk(struct sctp_t
                                atomic_add_int(&chk->whoTo->ref_count, 1);
                                chk->rec.data.TSN_seq = 
atomic_fetchadd_int(&stcb->asoc.sending_seq, 1);
                                stcb->asoc.pr_sctp_cnt++;
-                               chk->pr_sctp_on = 1;
                                TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, 
sctp_next);
                                stcb->asoc.sent_queue_cnt++;
                                stcb->asoc.pr_sctp_cnt++;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to