Add SO_REUSEPORT option for SSDP

fixes #541
This commit is contained in:
SeaEagle1 2021-04-22 01:19:57 +02:00 committed by Thomas Bernard
parent f13a79fabc
commit 1713f4b9b4
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,8 @@
$Id: Changelog.txt,v 1.475 2021/05/11 21:57:18 nanard Exp $
2021/04/22:
Add SO_REUSEPORT option for SSDP receive sockets
2021/03/31:
GetExternalIPAddress returns empty string when the External IP address can
not be retrieved.

View File

@ -2,7 +2,7 @@
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* MiniUPnP project
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
* (c) 2006-2020 Thomas Bernard
* (c) 2006-2021 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
@ -197,6 +197,10 @@ OpenAndConfSSDPReceiveSocket(int ipv6)
{
syslog(LOG_WARNING, "setsockopt(udp, SO_REUSEADDR): %m");
}
if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0)
{
syslog(LOG_WARNING, "setsockopt(udp, SO_REUSEPORT): %m");
}
#ifdef IP_RECVIF
/* BSD */
if(!ipv6) {