Skip to content

Commit e1f81c6

Browse files
authored
Merge pull request #11728 from wenduwan/nic_selection_b
opal/common/ofi: match openfabrics device by uuid and osname
2 parents 53ee39b + 2b282c1 commit e1f81c6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,14 @@ static bool is_near(pmix_device_distance_t *distances,
645645
continue;
646646

647647
for (i = 0; i < num_distances; i++) {
648-
char lsguid[256], lnguid[256];
648+
char lsguid[20], lnguid[20];
649649
int ret;
650650

651-
ret = sscanf(distances[i].uuid, "fab://%256s::%256s", lnguid, lsguid);
651+
if (!distances[i].osname || !osdev->name
652+
|| strcmp(distances[i].osname, osdev->name))
653+
continue;
654+
655+
ret = sscanf(distances[i].uuid, "fab://%19s::%19s", lnguid, lsguid);
652656
if (ret != 2)
653657
continue;
654658
if (nguid && (0 == strcasecmp(lnguid, nguid))) {

0 commit comments

Comments
 (0)