[ofa-general] [PATCHv5] OpenSM/osm_sa_mcmember_record.c: Collapse all scopes when consolidating IPv6 SNM
Hal Rosenstock
hrosenstock at xsigo.com
Sat May 31 10:31:57 PDT 2008
OpenSM/osm_sa_mcmember_record.c: In __search_mgrp_by_mgid, collapse all
scopes when consolidating IPv6 SNM
v5 changes PREFIX_MASK so low 16 bits are validated as 0
v4 fixes the original PREFIX_MASK as Sasha commented
v3 compares masked prefixes rather than actual prefix in MCMemberRecord
MGID and MGRP
v2 had a minor comment change
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 040068f..c14632d 100644
--- a/opensm/opensm/osm_sa_mcmember_record.c
+++ b/opensm/opensm/osm_sa_mcmember_record.c
@@ -1083,19 +1083,21 @@ __search_mgrp_by_mgid(IN cl_map_item_t * const p_map_item, IN void *context)
if (sa->p_subn->opt.consolidate_ipv6_snm_req) {
/* Special Case IPv6 Solicited Node Multicast (SNM) addresses */
- /* 0xff12601bXXXX0000 : 0x00000001ffYYYYYY */
- /* Where XXXX is the P_Key and
+ /* 0xff1Z601bXXXX0000 : 0x00000001ffYYYYYY */
+ /* Where Z is the scope, XXXX is the P_Key, and
* YYYYYY is the last 24 bits of the port guid */
-#define PREFIX_MASK (0xff12601b00000000ULL)
+#define PREFIX_MASK (0xff10ffff0000ffffULL)
+#define PREFIX_SIGNATURE (0xff10601b00000000ULL)
#define INT_ID_MASK (0x00000001ff000000ULL)
uint64_t g_prefix = cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix);
uint64_t g_interface_id = cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id);
uint64_t rcv_prefix = cl_ntoh64(p_recvd_mgid->unicast.prefix);
uint64_t rcv_interface_id = cl_ntoh64(p_recvd_mgid->unicast.interface_id);
- if ((rcv_prefix & PREFIX_MASK) == PREFIX_MASK &&
+ if ((rcv_prefix & PREFIX_MASK) == PREFIX_SIGNATURE &&
(rcv_interface_id & INT_ID_MASK) == INT_ID_MASK &&
- g_prefix == rcv_prefix &&
+ (g_prefix & PREFIX_MASK) ==
+ (rcv_prefix && PREFIX_MASK) &&
(g_interface_id & INT_ID_MASK) ==
(rcv_interface_id & INT_ID_MASK)) {
OSM_LOG(sa->p_log, OSM_LOG_INFO,
More information about the general
mailing list