|
3 | 3 | * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana |
4 | 4 | * University Research and Technology |
5 | 5 | * Corporation. All rights reserved. |
6 | | - * Copyright (c) 2004-2014 The University of Tennessee and The University |
| 6 | + * Copyright (c) 2004-2017 The University of Tennessee and The University |
7 | 7 | * of Tennessee Research Foundation. All rights |
8 | 8 | * reserved. |
9 | 9 | * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
@@ -828,20 +828,13 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr |
828 | 828 | /* No further use of this socket. Close it */ |
829 | 829 | CLOSE_THE_SOCKET(sd); |
830 | 830 | { |
831 | | - char *addr_str=NULL, *tmp, pnet[1024]; |
| 831 | + char *addr_str = NULL, *tmp, *pnet; |
832 | 832 | for (size_t i = 0; i < btl_proc->proc_endpoint_count; i++) { |
833 | 833 | mca_btl_base_endpoint_t* btl_endpoint = btl_proc->proc_endpoints[i]; |
834 | 834 | if (btl_endpoint->endpoint_addr->addr_family != addr->sa_family) { |
835 | 835 | continue; |
836 | 836 | } |
837 | | - if (AF_INET == addr->sa_family) { |
838 | | - inet_ntop(AF_INET, (void*)(struct in_addr*)&btl_endpoint->endpoint_addr->addr_inet, pnet, 1024); |
839 | | - } else if (AF_INET6 == addr->sa_family) { |
840 | | - inet_ntop(AF_INET6, (void*)(struct in6_addr*)&btl_endpoint->endpoint_addr->addr_inet, pnet, 1024); |
841 | | - } else { |
842 | | - /* unrecognized family */ |
843 | | - continue; |
844 | | - } |
| 837 | + pnet = opal_net_get_hostname((struct sockaddr*)&btl_endpoint->endpoint_addr->addr_inet); |
845 | 838 | if (NULL == addr_str) { |
846 | 839 | (void)asprintf(&tmp, "\n\t%s", pnet); |
847 | 840 | } else { |
|
0 commit comments