@@ -1355,12 +1355,10 @@ static void mca_btl_tcp_component_recv_handler(int sd, short flags, void* user)
13551355 char str [128 ];
13561356
13571357 /* Note, Socket will be in blocking mode during intial handshake
1358- * hence setting SO_RCVTIMEO to say 2 seconds here to avoid chance
1359- * of spin forever if it tries to connect to old version
1360- * as older version will send just process id which won't be long enough
1361- * to cross sizeof(str) length + process id struct
1362- * or when the remote side isn't OMPI where it's not going to send
1363- * any data*/
1358+ * hence setting SO_RCVTIMEO to say 2 seconds here to avoid waiting
1359+ * forever when connecting to older versions (that reply to the
1360+ * handshake with only the guid) or when the remote side isn't OMPI
1361+ */
13641362
13651363 /* get the current timeout value so we can reset to it */
13661364 if (0 != getsockopt (sd , SOL_SOCKET , SO_RCVTIMEO , (void * )& save , & rcvtimeo_save_len )) {
@@ -1387,7 +1385,6 @@ static void mca_btl_tcp_component_recv_handler(int sd, short flags, void* user)
13871385
13881386 OBJ_RELEASE (event );
13891387 retval = mca_btl_tcp_recv_blocking (sd , (void * )& hs_msg , sizeof (hs_msg ));
1390- guid = hs_msg .guid ;
13911388
13921389 /* An unknown process attempted to connect to Open MPI via TCP.
13931390 * Open MPI uses a "magic" string to trivially verify that the connecting
@@ -1413,6 +1410,8 @@ static void mca_btl_tcp_component_recv_handler(int sd, short flags, void* user)
14131410 CLOSE_THE_SOCKET (sd );
14141411 return ;
14151412 }
1413+
1414+ guid = hs_msg .guid ;
14161415 if (0 != strncmp (hs_msg .magic_id , mca_btl_tcp_magic_id_string , len )) {
14171416 opal_output_verbose (20 , opal_btl_base_framework .framework_output ,
14181417 "process did not receive right magic string. "
0 commit comments