From d6442115f89a76bf98bb488f02d945992e1185ef Mon Sep 17 00:00:00 2001 From: ftillier Date: Mon, 14 Nov 2005 18:41:29 +0000 Subject: [PATCH] [IBAL] Handle RMPP AttributeOffset = 0. Submitted by Guy Corem (guyc@voltaire.com) git-svn-id: svn://openib.tc.cornell.edu/gen1@151 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al_query.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/trunk/core/al/al_query.c b/trunk/core/al/al_query.c index f6fd620d..8dc88981 100644 --- a/trunk/core/al/al_query.c +++ b/trunk/core/al/al_query.c @@ -332,9 +332,17 @@ query_req_cb( CL_ASSERT( p_mad_response ); p_sa_mad = (ib_sa_mad_t*)p_mad_response->p_mad_buf; - query_rec.result_cnt = - ( ( p_mad_response->size - IB_SA_MAD_HDR_SIZE ) / - ib_get_attr_size( p_sa_mad->attr_offset ) ); + if (ib_get_attr_size( p_sa_mad->attr_offset ) != 0) + { + query_rec.result_cnt = + ( ( p_mad_response->size - IB_SA_MAD_HDR_SIZE ) / + ib_get_attr_size( p_sa_mad->attr_offset ) ); + } + else + { + query_rec.result_cnt = 0; + } + query_rec.p_result_mad = p_mad_response; } else -- 2.41.0