[openib-general] [PATCH] opensm: clean old references on ports linking

Sasha Khapyorsky sashak at voltaire.com
Sun Dec 24 09:43:15 PST 2006


When linking ports, cleanup old remote references. Without it the ports
still be accessible as "linked" from old neighbors and in case of ports
moving, when some MADs can be lost or reordered, OpenSM subnet data
structures become broken.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/opensm/osm_node.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/osm/opensm/osm_node.c b/osm/opensm/osm_node.c
index 684eee6..6e72b58 100644
--- a/osm/opensm/osm_node.c
+++ b/osm/opensm/osm_node.c
@@ -195,6 +195,11 @@ osm_node_link(
   p_remote_physp =  osm_node_get_physp_ptr( p_remote_node,
                                             remote_port_num );
 
+  if (p_physp->p_remote_physp)
+    p_physp->p_remote_physp->p_remote_physp = NULL;
+  if (p_remote_physp->p_remote_physp)
+    p_remote_physp->p_remote_physp->p_remote_physp = NULL;
+
   osm_physp_link( p_physp, p_remote_physp );
 }
 
-- 
1.4.4.2.gfc82d





More information about the general mailing list