@@ -858,13 +858,18 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
858858 freeaddrinfo (res );
859859
860860#ifdef IPV6_V6ONLY
861- /* in case of AF_INET6, disable v4-mapped addresses */
861+ /* If this OS supports the "IPV6_V6ONLY" constant, then set it
862+ on this socket. It specifies that *only* V6 connections
863+ should be accepted on this socket (vs. allowing incoming
864+ both V4 and V6 connections -- which is actually defined
865+ behavior for V6<-->V4 interop stuff). See
866+ https://github.com/open-mpi/ompi/commit/95d7e08a6617530d57b6700c57738b351bfccbf8 for some
867+ more details. */
862868 if (AF_INET6 == af_family ) {
863869 int flg = 1 ;
864870 if (setsockopt (sd , IPPROTO_IPV6 , IPV6_V6ONLY ,
865871 (char * ) & flg , sizeof (flg )) < 0 ) {
866- opal_output (0 ,
867- "mca_btl_tcp_create_listen: unable to disable v4-mapped addresses\n" );
872+ BTL_ERROR ((0 , "mca_btl_tcp_create_listen: unable to set IPV6_V6ONLY\n" ));
868873 }
869874 }
870875#endif /* IPV6_V6ONLY */
@@ -906,6 +911,10 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
906911#else
907912 ((struct sockaddr_in * ) & inaddr )-> sin_port = htons (port + index );
908913#endif /* OPAL_ENABLE_IPV6 */
914+ opal_output_verbose (30 , opal_btl_base_framework .framework_output ,
915+ "btl:tcp: Attempting to bind to %s port %d" ,
916+ (AF_INET == af_family ) ? "AF_INET" : "AF_INET6" ,
917+ port + index );
909918 if (bind (sd , (struct sockaddr * )& inaddr , addrlen ) < 0 ) {
910919 if ( (EADDRINUSE == opal_socket_errno ) || (EADDRNOTAVAIL == opal_socket_errno ) ) {
911920 continue ;
@@ -915,6 +924,10 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
915924 CLOSE_THE_SOCKET (sd );
916925 return OPAL_ERROR ;
917926 }
927+ opal_output_verbose (30 , opal_btl_base_framework .framework_output ,
928+ "btl:tcp: Successfully bound to %s port %d" ,
929+ (AF_INET == af_family ) ? "AF_INET" : "AF_INET6" ,
930+ port + index );
918931 goto socket_binded ;
919932 }
920933#if OPAL_ENABLE_IPV6
@@ -945,6 +958,9 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
945958 if (AF_INET6 == af_family ) {
946959 mca_btl_tcp_component .tcp6_listen_port = ((struct sockaddr_in6 * ) & inaddr )-> sin6_port ;
947960 mca_btl_tcp_component .tcp6_listen_sd = sd ;
961+ opal_output_verbose (30 , opal_btl_base_framework .framework_output ,
962+ "btl:tcp: my listening v6 socket port is %d" ,
963+ ntohs (mca_btl_tcp_component .tcp6_listen_port ));
948964 } else
949965#endif
950966 {
@@ -1143,6 +1159,8 @@ static int mca_btl_tcp_component_exchange(void)
11431159 addrs [current_addr ].addr_ifkindex =
11441160 opal_ifindextokindex (index );
11451161 current_addr ++ ;
1162+ opal_output_verbose (30 , opal_btl_base_framework .framework_output ,
1163+ "btl:tcp: using ipv6 interface %s" , ifn );
11461164 }
11471165 } /* end of for opal_ifbegin() */
11481166 } /* end of for tcp_num_btls */
0 commit comments