From 4514ba5e2f597b3ecbedda2eee48bebf8ae693fe Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Wed, 10 Jun 2020 09:42:23 +0200 Subject: [PATCH] Cedar/Server.c: load UDP ports from configuration file and apply them Unfortunately I realized only now that I didn't add the code in c4ec63fe3262d86391bb7b89d4ccf712f699c022. --- src/Cedar/Server.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Cedar/Server.c b/src/Cedar/Server.c index 8c892a9d..9d1efe94 100644 --- a/src/Cedar/Server.c +++ b/src/Cedar/Server.c @@ -5676,6 +5676,23 @@ void SiLoadServerCfg(SERVER *s, FOLDER *f) { OPENVPN_SSTP_CONFIG config; FOLDER *syslog_f; + { + UINT i; + LIST *ports; + + // Load and set UDP ports + CfgGetStr(f, "PortsUDP", tmp, sizeof(tmp)); + NormalizeIntListStr(tmp, sizeof(tmp), tmp, true, ", "); + + ports = StrToIntList(tmp, true); + for (i = 0; i < LIST_NUM(ports); ++i) + { + AddInt(s->PortsUDP, *(UINT *)LIST_DATA(ports, i)); + } + ReleaseIntList(ports); + + ProtoSetUdpPorts(s->Proto, ports); + } { RPC_KEEP k;