[openib-general] [PATCH] OpenSM/osm_sa_mcmember_record.c: In osm_mcmr_rcv_create_new_mgrp, fix exactly selectors in response

Hal Rosenstock halr at voltaire.com
Mon Sep 18 17:30:37 PDT 2006


OpenSM/osm_sa_mcmember_record.c: In osm_mcmr_rcv_create_new_mgrp, set
exactly selectors after rather than before mgrp is initialized

Pointed out by: Roland Dreier <rdreier at cisco.com>

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

Index: opensm/osm_sa_mcmember_record.c
===================================================================
--- opensm/osm_sa_mcmember_record.c	(revision 9347)
+++ opensm/osm_sa_mcmember_record.c	(working copy)
@@ -1337,15 +1337,18 @@ osm_mcmr_rcv_create_new_mgrp(
     goto Exit;
   }
 
-  /* the mcmember_record should have mtu_sel, rate_sel and pkt_lifetime_sel = 2 */
-  (*pp_mgrp)->mcmember_rec.mtu |= 2<<6; /* exactly */
-  (*pp_mgrp)->mcmember_rec.rate |= 2<<6; /* exactly */
-  (*pp_mgrp)->mcmember_rec.pkt_life |= 2<<6; /* exactly */
-
   /* Initialize the mgrp */
   (*pp_mgrp)->mcmember_rec = mcm_rec;
   (*pp_mgrp)->mcmember_rec.mlid = mlid;
 
+  /* the mcmember_record should have mtu_sel, rate_sel, and pkt_lifetime_sel = 2 */
+  (*pp_mgrp)->mcmember_rec.mtu &= 0x3f;
+  (*pp_mgrp)->mcmember_rec.mtu |= 2<<6; /* exactly */
+  (*pp_mgrp)->mcmember_rec.rate &= 0x3f;
+  (*pp_mgrp)->mcmember_rec.rate |= 2<<6; /* exactly */
+  (*pp_mgrp)->mcmember_rec.pkt_life &= 0x3f;
+  (*pp_mgrp)->mcmember_rec.pkt_life |= 2<<6; /* exactly */
+
   /* Insert the new group in the data base */
   
   /* since we might have an old group by that mlid







More information about the general mailing list