1
1

Convert the port number in network order before binding the socket.

Thanks to Mariusz Mamonski (mamonski@man.poznan.pl) for the bug
report and patch.

This commit was SVN r21610.
Этот коммит содержится в:
George Bosilca 2009-07-07 17:21:28 +00:00
родитель 90d719125c
Коммит 4038834dfb

Просмотреть файл

@ -702,9 +702,9 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
for( index = 0; index < range; index++ ) {
#if OPAL_WANT_IPV6
((struct sockaddr_in6*) &inaddr)->sin6_port = port + index;
((struct sockaddr_in6*) &inaddr)->sin6_port = htons(port + index);
#else
((struct sockaddr_in*) &inaddr)->sin_port = port + index;
((struct sockaddr_in*) &inaddr)->sin_port = htons(port + index);
#endif /* OPAL_WANT_IPV6 */
if(bind(sd, (struct sockaddr*)&inaddr, addrlen) < 0) {
if( (EADDRINUSE == opal_socket_errno) || (EADDRNOTAVAIL == opal_socket_errno) ) {