* [PATCH] opensm/osm_port_info_rcv.c: Handle non-compliant SMA gracefully
@ 2012-06-28 17:12 Hal Rosenstock
0 siblings, 0 replies; only message in thread
From: Hal Rosenstock @ 2012-06-28 17:12 UTC (permalink / raw)
To: Alex Netes
Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
If PortInfo.LocalPortNum > NodeInfo.NumPorts, then SMA is
not compliant. In this case, ignore the portinfo response.
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
opensm/osm_port_info_rcv.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c
index a4f81a8..d243bb2 100644
--- a/opensm/osm_port_info_rcv.c
+++ b/opensm/osm_port_info_rcv.c
@@ -552,6 +552,18 @@ void osm_pi_rcv_process(IN void *context, IN void *data)
p_node = p_port->p_node;
CL_ASSERT(p_node);
+ if (p_pi->local_port_num > p_node->node_info.num_ports) {
+ CL_PLOCK_RELEASE(sm->p_lock);
+ OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0F09: "
+ "PortInfo from %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_node->node_info.node_type),
+ cl_ntoh64(p_node->node_info.node_guid),
+ p_pi->local_port_num, p_node->node_info.num_ports);
+ goto Exit;
+ }
+
/*
If we were setting the PortInfo, then receiving
this attribute was not part of sweeping the subnet.
--
1.7.8.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-28 17:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 17:12 [PATCH] opensm/osm_port_info_rcv.c: Handle non-compliant SMA gracefully Hal Rosenstock
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.