This patch fixed a bug in the marshalling code that handles queue
capacity thresholds. Specifically, the three functions were not
completely handling the array values due to an error in the for
loop. The upper bound on the for loop should be "less than or equal
to", not "less than".

Ryan

Index: include/mar_msg.h
===================================================================
--- include/mar_msg.h   (revision 2117)
+++ include/mar_msg.h   (working copy)
@@ -368,7 +368,7 @@
 {
        int i;
 
-       for (i = SA_MSG_MESSAGE_HIGHEST_PRIORITY; i < 
SA_MSG_MESSAGE_LOWEST_PRIORITY; i++) {
+       for (i = SA_MSG_MESSAGE_HIGHEST_PRIORITY; i <= 
SA_MSG_MESSAGE_LOWEST_PRIORITY; i++) {
                swab_mar_size_t (&to_swab->capacity_reached[i]);
                swab_mar_size_t (&to_swab->capacity_available[i]);
        }
@@ -380,7 +380,7 @@
 {
        int i;
 
-       for (i = SA_MSG_MESSAGE_HIGHEST_PRIORITY; i < 
SA_MSG_MESSAGE_LOWEST_PRIORITY; i++) {
+       for (i = SA_MSG_MESSAGE_HIGHEST_PRIORITY; i <= 
SA_MSG_MESSAGE_LOWEST_PRIORITY; i++) {
                dst->capacityReached[i] = src->capacity_reached[i];
                dst->capacityAvailable[i] = src->capacity_available[i];
        }
@@ -392,7 +392,7 @@
 {
        int i;
 
-       for (i = SA_MSG_MESSAGE_HIGHEST_PRIORITY; i < 
SA_MSG_MESSAGE_LOWEST_PRIORITY; i++) {
+       for (i = SA_MSG_MESSAGE_HIGHEST_PRIORITY; i <= 
SA_MSG_MESSAGE_LOWEST_PRIORITY; i++) {
                dst->capacity_reached[i] = src->capacityReached[i];
                dst->capacity_available[i] = src->capacityAvailable[i];
        }
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to