[ofa-general] [PATCH] opensm/osm_sa_mcmember_record.c: Fix some off by 1 issues related to max_multicast_lid_ho

Hal Rosenstock hrosenstock at xsigo.com
Fri Jun 20 11:57:39 PDT 2008


opensm/osm_sa_mcmember_record.c: Fix some off by 1 issues related to
max_multicast_lid_ho

Signed-off-by: Hal Rosenstock <hal at xsigo.com>

diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c
index c0405f6..46c87c7 100644
--- a/opensm/opensm/osm_sa_mcmember_record.c
+++ b/opensm/opensm/osm_sa_mcmember_record.c
@@ -153,7 +153,7 @@ __get_new_mlid(IN osm_sa_t * sa, IN ib_net16_t requested_mlid)
 	OSM_LOG_ENTER(sa->p_log);
 
 	if (requested_mlid && cl_ntoh16(requested_mlid) >= IB_LID_MCAST_START_HO
-	    && cl_ntoh16(requested_mlid) < p_subn->max_multicast_lid_ho
+	    && cl_ntoh16(requested_mlid) <= p_subn->max_multicast_lid_ho
 	    && cl_qmap_get(&p_subn->mgrp_mlid_tbl,
 			   requested_mlid) ==
 	    cl_qmap_end(&p_subn->mgrp_mlid_tbl)) {
@@ -172,7 +172,7 @@ __get_new_mlid(IN osm_sa_t * sa, IN ib_net16_t requested_mlid)
 	}
 
 	max_num_mlids =
-	    sa->p_subn->max_multicast_lid_ho - IB_LID_MCAST_START_HO;
+	    sa->p_subn->max_multicast_lid_ho - IB_LID_MCAST_START_HO + 1;
 
 	/* track all used mlids in the array (by mlid index) */
 	used_mlids_array = (uint8_t *) malloc(sizeof(uint8_t) * max_num_mlids);





More information about the general mailing list