From: Hal Rosenstock <[email protected]>

If NodeInfo.LocalPortNum > NodeInfo.NumPorts, then SMA is
not compliant. In this case, ignore the node and don't add
it to any subnet data structures.

Signed-off-by: Hal Rosenstock <[email protected]>
Signed-off-by: Alex Netes <[email protected]>
---
 opensm/osm_node_info_rcv.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c
index c35aea4..75ab853 100644
--- a/opensm/osm_node_info_rcv.c
+++ b/opensm/osm_node_info_rcv.c
@@ -624,6 +624,17 @@ static void ni_rcv_process_new(IN osm_sm_t * sm, IN const 
osm_madw_t * p_madw)
                ib_get_node_type_str(p_ni->node_type),
                cl_ntoh64(p_ni->node_guid), cl_ntoh64(p_smp->trans_id));
 
+       if (port_num > p_ni->num_ports) {
+               OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D0A: "
+                       "New %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;
+       }
+
        p_node = osm_node_new(p_madw);
        if (p_node == NULL) {
                OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D07: "
-- 
1.7.11.2

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

Reply via email to