diff mbox

opensm/osm_node_info_rec.c: Also handle non compliant SMA in ni_rcv_process_existing

Message ID 4FF19A0C.9010201@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock July 2, 2012, 12:54 p.m. UTC
in case of NodeInfo.LocalPortNum > NodeInfo.NumPorts

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 opensm/osm_node_info_rcv.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Comments

Alex Netes July 25, 2012, 7:51 a.m. UTC | #1
Hi Hal,

On 08:54 Mon 02 Jul     , Hal Rosenstock wrote:
> 
> in case of NodeInfo.LocalPortNum > NodeInfo.NumPorts
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied, thanks.
--
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/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c
index 9375e36..12e7693 100644
--- a/opensm/osm_node_info_rcv.c
+++ b/opensm/osm_node_info_rcv.c
@@ -782,6 +782,17 @@  static void ni_rcv_process_existing(IN osm_sm_t * sm, IN osm_node_t * p_node,
 		cl_ntoh64(p_ni->node_guid),
 		cl_ntoh64(p_smp->trans_id), p_node->discovery_count);
 
+	if (port_num > p_ni->num_ports) {
+		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D0C: "
+			"Existing %s node GUID 0x%" PRIx64 "is non-compliant "
+			"and is being ignored since the "
+			"local port num %u > num ports %u\n",
+			ib_get_node_type_str(p_ni->node_type),
+			cl_ntoh64(p_ni->node_guid), port_num,
+			p_ni->num_ports);
+		goto Exit;
+	}
+
 	/*
 	   If we haven't already encountered this existing node
 	   on this particular sweep, then process further.
@@ -807,6 +818,7 @@  static void ni_rcv_process_existing(IN osm_sm_t * sm, IN osm_node_t * p_node,
 
 	ni_rcv_set_links(sm, p_node, port_num, p_ni_context);
 
+Exit:
 	OSM_LOG_EXIT(sm->p_log);
 }