]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
disable DCO if no --dev was specified
authorAntonio Quartulli <a@unstable.cc>
Mon, 1 Aug 2022 15:08:12 +0000 (17:08 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 1 Aug 2022 15:16:03 +0000 (17:16 +0200)
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 <frank@lichtenheld.com>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
src/openvpn/dco.c

index 0471e4d0b6e346d98410f1eba2e43a79f201182a..b0dd922a1b9f4984c9db203b1b295bd67649d49f 100644 (file)
@@ -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;