diff mbox

libvendor/osm_vendor_ibumad.c: fix mad validation in case of multipath record response

Message ID 5124E1F6.3060501@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock Feb. 20, 2013, 2:47 p.m. UTC
o15-0.2-1.11: SA response to a SubnAdmGetMulti() containing
MultiPathRecord shall have PathRecord attribute ID.

Signed-off-by: Daniel Klein <danielk@mellanox.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/libvendor/osm_vendor_ibumad.c b/libvendor/osm_vendor_ibumad.c
index 63b9594..f0427a3 100644
--- a/libvendor/osm_vendor_ibumad.c
+++ b/libvendor/osm_vendor_ibumad.c
@@ -415,10 +415,18 @@  static void *umad_receiver(void *p_ptr)
 			 * and make sure that attribute ID, attribute
 			 * modifier and transaction ID are the same in
 			 * request and response.
+			 *
+			 * Exception for o15-0.2-1.11:
+			 * SA response to a SubnAdmGetMulti() containing a
+			 * MultiPathRecord shall have PathRecord attribute ID.
 			 */
 			p_req_mad = osm_madw_get_mad_ptr(p_req_madw);
 			if (PF(ib_mad_is_response(p_req_mad) ||
-			       p_mad->attr_id != p_req_mad->attr_id ||
+			       (p_mad->attr_id != p_req_mad->attr_id &&
+                                !(p_mad->mgmt_class == IB_MCLASS_SUBN_ADM &&
+                                  p_req_mad->attr_id ==
+					IB_MAD_ATTR_MULTIPATH_RECORD &&
+                                  p_mad->attr_id == IB_MAD_ATTR_PATH_RECORD)) ||
 			       p_mad->attr_mod != p_req_mad->attr_mod ||
 			       p_mad->trans_id != p_req_mad->trans_id)) {
 				OSM_LOG(p_vend->p_log, OSM_LOG_ERROR,