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/branches/branch-1.6.x@548 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user