diff mbox

opensm/osm_ucast_ftree.c: fix opensm segfault in osm_ucast_ftree.c

Message ID 1359984011-30753-8-git-send-email-alexne@mellanox.com (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Alex Netes Feb. 4, 2013, 1:20 p.m. UTC
From: Vincent Ficet <jean-vincent.ficet@bull.net>

Instead of unconditionnally assigning valid port numbers to the lft table, it now leaves 'holes' filled with the default value OSM_NO_PATH (=255)
Accessing these invalid/unassigned LFT entries yields invalid addresses starting with 0xff as in the above example.

After reverting commit 81dade3aeb1d5c80472a4f9fef55e9916bb38d3a and applying the above patch, we have not observed any multicast loop nor any segmentation fault.

Reproducing this bug using ibsim is easy:
1/ Load a fat-tree topology
2/ Unlink a leaf switch
3/ Start opensm (configured with the ftree routing engine)
4/ Relink the leaf switch

Signed-off-by: Vincent Ficet <jean-vincent.ficet@bull.net>
Signed-off-by: Alex Netes <alexne@mellanox.com>
---
 opensm/osm_ucast_ftree.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c
index c81e7a3..932ec6a 100644
--- a/opensm/osm_ucast_ftree.c
+++ b/opensm/osm_ucast_ftree.c
@@ -4171,6 +4171,9 @@  static int construct_fabric(IN void *context)
 	OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,
 		"Max LID in switch LFTs: %u\n", p_ftree->lft_max_lid);
 
+	/* Build the full lid matrices needed for multicast routing */
+	osm_ucast_mgr_build_lid_matrices(&p_ftree->p_osm->sm.ucast_mgr);
+
 Exit:
 	if (status != 0) {
 		OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,