Author: rrs
Date: Sat Apr 17 04:19:18 2010
New Revision: 206744
URL: http://svn.freebsd.org/changeset/base/206744

Log:
  MFC of  206281
  
  Final MFC of all the IETF hack a-thon.. head and stable are
  now in sync ;-)

Modified:
  stable/8/sys/netinet/sctp_indata.c
  stable/8/sys/netinet/sctputil.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netinet/sctp_indata.c
==============================================================================
--- stable/8/sys/netinet/sctp_indata.c  Sat Apr 17 04:17:17 2010        
(r206743)
+++ stable/8/sys/netinet/sctp_indata.c  Sat Apr 17 04:19:18 2010        
(r206744)
@@ -2275,8 +2275,7 @@ sctp_slide_mapping_arrays(struct sctp_tc
        asoc->cumulative_tsn = asoc->mapping_array_base_tsn + (at - 1);
 
        if (compare_with_wrap(asoc->cumulative_tsn, 
asoc->highest_tsn_inside_map, MAX_TSN) &&
-           compare_with_wrap(asoc->cumulative_tsn, 
asoc->highest_tsn_inside_nr_map, MAX_TSN)
-           ) {
+           compare_with_wrap(asoc->cumulative_tsn, 
asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
 #ifdef INVARIANTS
                panic("huh, cumack 0x%x greater than high-tsn 0x%x in map",
                    asoc->cumulative_tsn, asoc->highest_tsn_inside_map);
@@ -2378,7 +2377,7 @@ sctp_slide_mapping_arrays(struct sctp_tc
                                    asoc->nr_mapping_array[slide_from + ii];
 
                        }
-                       for (ii = distance; ii <= asoc->mapping_array_size; 
ii++) {
+                       for (ii = distance; ii < asoc->mapping_array_size; 
ii++) {
                                asoc->mapping_array[ii] = 0;
                                asoc->nr_mapping_array[ii] = 0;
                        }

Modified: stable/8/sys/netinet/sctputil.c
==============================================================================
--- stable/8/sys/netinet/sctputil.c     Sat Apr 17 04:17:17 2010        
(r206743)
+++ stable/8/sys/netinet/sctputil.c     Sat Apr 17 04:19:18 2010        
(r206744)
@@ -1187,50 +1187,38 @@ sctp_init_asoc(struct sctp_inpcb *m, str
 void
 sctp_print_mapping_array(struct sctp_association *asoc)
 {
-       int i, limit;
+       unsigned int i, limit;
 
-       printf("Mapping size:%d baseTSN:%8.8x cumAck:%8.8x highestTSN:%8.8x\n",
+       printf("Mapping array size: %d, baseTSN: %8.8x, cumAck: %8.8x, 
highestTSN: (%8.8x, %8.8x).\n",
            asoc->mapping_array_size,
            asoc->mapping_array_base_tsn,
            asoc->cumulative_tsn,
-           asoc->highest_tsn_inside_map
-           );
-       limit = asoc->mapping_array_size;
-       for (i = asoc->mapping_array_size; i >= 0; i--) {
-               if (asoc->mapping_array[i]) {
-                       limit = i;
+           asoc->highest_tsn_inside_map,
+           asoc->highest_tsn_inside_nr_map);
+       for (limit = asoc->mapping_array_size; limit > 1; limit--) {
+               if (asoc->mapping_array[limit - 1]) {
                        break;
                }
        }
-       if (limit == 0)
-               limit = 1;
+       printf("Renegable mapping array (last %d entries are zero):\n", 
asoc->mapping_array_size - limit);
        for (i = 0; i < limit; i++) {
-               printf("%2.2x ", asoc->mapping_array[i]);
+               printf("%2.2x%c", asoc->mapping_array[i], ((i + 1) % 16) ? ' ' 
: '\n');
                if (((i + 1) % 16) == 0)
                        printf("\n");
        }
-       printf("\n");
-       printf("NR Mapping size:%d baseTSN:%8.8x highestTSN:%8.8x\n",
-           asoc->mapping_array_size,
-           asoc->mapping_array_base_tsn,
-           asoc->highest_tsn_inside_nr_map
-           );
-       limit = asoc->mapping_array_size;
-       for (i = asoc->mapping_array_size; i >= 0; i--) {
-               if (asoc->nr_mapping_array[i]) {
-                       limit = i;
+       if (limit % 16)
+               printf("\n");
+       for (limit = asoc->mapping_array_size; limit > 1; limit--) {
+               if (asoc->nr_mapping_array[limit - 1]) {
                        break;
                }
        }
-       if (limit == 0)
-               limit = 1;
-
+       printf("Non renegable mapping array (last %d entries are zero):\n", 
asoc->mapping_array_size - limit);
        for (i = 0; i < limit; i++) {
-               printf("%2.2x ", asoc->nr_mapping_array[i]);
-               if (((i + 1) % 16) == 0)
-                       printf("\n");
+               printf("%2.2x%c", asoc->mapping_array[i], ((i + 1) % 16) ? ' ' 
: '\n');
        }
-       printf("\n");
+       if (limit % 16)
+               printf("\n");
 }
 
 int
@@ -1240,9 +1228,7 @@ sctp_expand_mapping_array(struct sctp_as
        uint8_t *new_array1, *new_array2;
        uint32_t new_size;
 
-
        new_size = asoc->mapping_array_size + ((needed + 7) / 8 + 
SCTP_MAPPING_ARRAY_INCR);
-
        SCTP_MALLOC(new_array1, uint8_t *, new_size, SCTP_M_MAP);
        SCTP_MALLOC(new_array2, uint8_t *, new_size, SCTP_M_MAP);
        if ((new_array1 == NULL) || (new_array2 == NULL)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to