]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Assign and honour signal priority order
authorSelva Nair <selva.nair@gmail.com>
Sun, 1 Jan 2023 21:51:07 +0000 (16:51 -0500)
committerGert Doering <gert@greenie.muc.de>
Sun, 8 Jan 2023 16:48:22 +0000 (17:48 +0100)
commitb3b1436955b9db8e557fc58b7e37ba3a881109a6
treec7b57cbcd79c43fc41907b5241e634b3e6617897
parentdec9c03d0f6e184fb6cce16b554491d62622425c
Assign and honour signal priority order

Signals are ordered as SIGUSR2, SIGUSR1, SIGHUP, SIGTERM, SIGINT
in increasing priority. Lower priority signals are not allowed to
overwrite higher ones.

This should fix Trac #311, #639 -- SIGTER/SIGINT lost during dns
resolution (except for the Windows-specific bug handled in previous commit).

On sending SIGTERM during dns resolution, it still takes several seconds
to terminate as the signal will get processed only after getaddrinfo times
out twice (in phase1 and phase2 inits).

Github: fixes OpenVPN/openvpn#205
Trac: #311, #639

Note: one has to still wait for address resolution to time out as
getaddrinfo() is no interruptible. But a single ctrl-C (and some
patience) is enough.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230101215109.1521549-4-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25871.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 3a7257925791a086c1ac88362a8eb422be518b14)
src/openvpn/proxy.c
src/openvpn/sig.c
src/openvpn/socket.c
src/openvpn/socks.c