From 4cfe4f9e339c143de264d7b41f97afd8e5e745ca Mon Sep 17 00:00:00 2001 From: ftillier Date: Wed, 6 Jul 2005 18:55:04 +0000 Subject: [PATCH] Fix truncation error in timeout calculation for MADs by properly casting 32-bit values to 64-bits before performing arithmetic operations. git-svn-id: svn://openib.tc.cornell.edu/gen1@22 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- branches/fab_cm_branch/core/al/al_mad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/branches/fab_cm_branch/core/al/al_mad.c b/branches/fab_cm_branch/core/al/al_mad.c index d408a7cc..a909da90 100644 --- a/branches/fab_cm_branch/core/al/al_mad.c +++ b/branches/fab_cm_branch/core/al/al_mad.c @@ -1873,7 +1873,7 @@ ib_delay_mad( if( h_send->retry_time == MAX_TIME ) h_send->delay = delay_ms; else - h_send->retry_time += (delay_ms * 1000); + h_send->retry_time += ((uint64_t)delay_ms * 1000ULL); cl_spinlock_release( &h_mad_svc->obj.lock ); AL_EXIT( AL_DBG_MAD_SVC ); @@ -2930,7 +2930,7 @@ __set_retry_time( IN ib_mad_send_handle_t h_send ) { h_send->retry_time = - (h_send->p_send_mad->timeout_ms + h_send->delay) * 1000 + + (uint64_t)(h_send->p_send_mad->timeout_ms + h_send->delay) * 1000ULL + cl_get_time_stamp(); h_send->delay = 0; } -- 2.41.0