From b891fe113ca9d9a2a19552531d8e91b8dcf02164 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 12 Nov 2020 13:36:37 +0100 Subject: [PATCH] - Retry for interfaces with unused ports if possible. --- doc/Changelog | 1 + services/outside_network.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index e9b8649fd..613d14cb7 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 12 November 2020: Wouter - Fix to connect() to UDP destinations, default turned on, this lowers vulnerability to ICMP side channels. + - Retry for interfaces with unused ports if possible. 10 November 2020: Wouter - Fix #341: fixing a possible memory leak. diff --git a/services/outside_network.c b/services/outside_network.c index cef76053c..d184da545 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -1118,6 +1118,9 @@ select_ifport(struct outside_network* outnet, struct pending* pend, if(1) { /* if we connect() we cannot reuse fds for a port */ if(pif->inuse >= pif->avail_total) { + tries++; + if(tries < MAX_PORT_RETRY) + continue; log_err("failed to find an open port, drop msg"); return 0; } -- 2.47.3