Forward port of svn revision 548:

[svn] SF Bug Tracker [ 2995758 ] libupnp 1.6.6, wrong bind when reuseaddr is 1.
Submitted: viallard anthony ( homer242 )
When trying to use reuseaddr option in miniserver/miniserver.c, there
isn't a affectation of the port chosen (serverAddr.sin_port isn't
receive listen_port variable value).


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@549 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2010-05-07 11:20:00 +00:00
parent 71ec18a3a9
commit 54727b2a9e
3 changed files with 12 additions and 2 deletions

View File

@ -211,6 +211,14 @@ Version 1.8.0
Version 1.6.7
*******************************************************************************
2010-05-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
SF Bug Tracker [ 2995758 ] libupnp 1.6.6, wrong bind when reuseaddr is
1.
Submitted: viallard anthony ( homer242 )
When trying to use reuseaddr option in miniserver/miniserver.c, there
isn't a affectation of the port chosen (serverAddr.sin_port isn't
receive listen_port variable value).
2010-04-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
Define PROTOTYPES to be one by default in global.h. This affects the
RSA MD5 code.

1
THANKS
View File

@ -8,6 +8,7 @@ exempt of errors.
- Alex (afaucher)
- Andre Sodermans (wienerschnitzel)
- Anthony Viallard (homer242)
- Apostolos Syropoulos
- Arno Willig
- Bob Ciora

View File

@ -625,8 +625,8 @@ static int get_miniserver_sockets(
return UPNP_E_SOCKET_BIND;
}
sockError = bind(listenfd4, (struct sockaddr *)&__ss_v4,
sizeof (__ss_v4));
serverAddr4->sin_port = htons(listen_port4);
sockError = bind(listenfd4, (struct sockaddr *)&__ss_v4, sizeof (__ss_v4));
if (sockError == -1) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
@ -652,6 +652,7 @@ static int get_miniserver_sockets(
return UPNP_E_SOCKET_BIND;
}
serverAddr6->sin6_port = htons(listen_port6);
sockError = bind(listenfd6, (struct sockaddr *)&__ss_v6, sizeof (__ss_v6));
if (sockError == -1) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);