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.
Этот коммит содержится в:
родитель
90d719125c
Коммит
4038834dfb
@ -702,9 +702,9 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
|
|||||||
|
|
||||||
for( index = 0; index < range; index++ ) {
|
for( index = 0; index < range; index++ ) {
|
||||||
#if OPAL_WANT_IPV6
|
#if OPAL_WANT_IPV6
|
||||||
((struct sockaddr_in6*) &inaddr)->sin6_port = port + index;
|
((struct sockaddr_in6*) &inaddr)->sin6_port = htons(port + index);
|
||||||
#else
|
#else
|
||||||
((struct sockaddr_in*) &inaddr)->sin_port = port + index;
|
((struct sockaddr_in*) &inaddr)->sin_port = htons(port + index);
|
||||||
#endif /* OPAL_WANT_IPV6 */
|
#endif /* OPAL_WANT_IPV6 */
|
||||||
if(bind(sd, (struct sockaddr*)&inaddr, addrlen) < 0) {
|
if(bind(sd, (struct sockaddr*)&inaddr, addrlen) < 0) {
|
||||||
if( (EADDRINUSE == opal_socket_errno) || (EADDRNOTAVAIL == opal_socket_errno) ) {
|
if( (EADDRINUSE == opal_socket_errno) || (EADDRNOTAVAIL == opal_socket_errno) ) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user