From b8b0a95efff0184cebacc43a6e751fa8f9092cd8 Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Mon, 1 Aug 2022 17:08:12 +0200 Subject: [PATCH] disable DCO if no --dev was specified The DCO logic is unable to proceed without --dev argument, therefore just disable DCO if no --dev was specified by the user. Right now, calling openvpn with DCO enabled (default) and no --dev specified leads to a crash, because --dev is assumed to always be there. Reported-by: Frank Lichtenheld Signed-off-by: Antonio Quartulli Acked-by: Gert Doering Message-Id: <20220801150812.32561-1-a@unstable.cc> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24772.html Signed-off-by: Gert Doering --- src/openvpn/dco.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 0471e4d0b..b0dd922a1 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -164,6 +164,11 @@ dco_check_option_conflict(int msglevel, const struct options *o) return false; } + if (!o->dev) + { + return false; + } + if (!dco_check_option_conflict_platform(msglevel, o)) { return false; -- 2.47.2