[openib-general] [PATCH] osmtest/osmtest.c: Fix status decode in ib_get_mad_status_str

Hal Rosenstock halr at voltaire.com
Wed Jul 5 07:31:13 PDT 2006


osmtest/osmtest.c: Fix status decode in ib_get_mad_status_str

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: osmtest/osmtest.c
===================================================================
--- osmtest/osmtest.c	(revision 8370)
+++ osmtest/osmtest.c	(working copy)
@@ -284,7 +284,7 @@ ib_get_mad_status_str( IN const ib_mad_t
     strcat( &line[offset], ib_mad_status_str_redirect );
     offset += sizeof( ib_mad_status_str_redirect ) - 1;
   }
-  if( status & IB_MAD_STATUS_UNSUP_CLASS_VER )
+  if( ( status & IB_MAD_STATUS_INVALID_FIELD ) == IB_MAD_STATUS_UNSUP_CLASS_VER )
   {
     if( !first )
     {
@@ -295,7 +295,7 @@ ib_get_mad_status_str( IN const ib_mad_t
     strcat( &line[offset], ib_mad_status_str_unsup_class_ver );
     offset += sizeof( ib_mad_status_str_unsup_class_ver ) - 1;
   }
-  if( status & IB_MAD_STATUS_UNSUP_METHOD )
+  if( ( status & IB_MAD_STATUS_INVALID_FIELD ) == IB_MAD_STATUS_UNSUP_METHOD )
   {
     if( !first )
     {
@@ -306,7 +306,7 @@ ib_get_mad_status_str( IN const ib_mad_t
     strcat( &line[offset], ib_mad_status_str_unsup_method );
     offset += sizeof( ib_mad_status_str_unsup_method ) - 1;
   }
-  if( status & IB_MAD_STATUS_UNSUP_METHOD_ATTR )
+  if( (status & IB_MAD_STATUS_INVALID_FIELD ) == IB_MAD_STATUS_UNSUP_METHOD_ATTR )
   {
     if( !first )
     {
@@ -317,7 +317,7 @@ ib_get_mad_status_str( IN const ib_mad_t
     strcat( &line[offset], ib_mad_status_str_unsup_method_attr );
     offset += sizeof( ib_mad_status_str_unsup_method_attr ) - 1;
   }
-  if( status & IB_MAD_STATUS_INVALID_FIELD )
+  if( ( status & IB_MAD_STATUS_INVALID_FIELD ) == IB_MAD_STATUS_INVALID_FIELD )
   {
     if( !first )
     {







More information about the general mailing list