From 1713f4b9b4813e725ea7e27d89365b2b6ff21eb3 Mon Sep 17 00:00:00 2001 From: SeaEagle1 Date: Thu, 22 Apr 2021 01:19:57 +0200 Subject: [PATCH] Add SO_REUSEPORT option for SSDP fixes #541 --- miniupnpd/Changelog.txt | 3 +++ miniupnpd/minissdp.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index c604b45..8686a0b 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -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. diff --git a/miniupnpd/minissdp.c b/miniupnpd/minissdp.c index f96f75f..216a3d0 100644 --- a/miniupnpd/minissdp.c +++ b/miniupnpd/minissdp.c @@ -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) {