]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
tun: Remove one useless if check
authorFrank Lichtenheld <frank@lichtenheld.com>
Fri, 8 May 2026 15:34:53 +0000 (17:34 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 11 May 2026 17:03:43 +0000 (19:03 +0200)
The condition was already checked in an outer if check.

Identified by cppcheck.

Change-Id: I0aeb4583707a80592ec2577fbb060f7fbcb73e48
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1677
Message-Id: <20260508153458.13848-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36867.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c

index f46802fa2f5c04e0b871218d4e2c2be48800ed5d..e7193d87b1a0e8ef8b8da26b3cfd16ff880819f6 100644 (file)
@@ -5772,13 +5772,10 @@ tun_try_open_device(struct tuntap *tt, const char *device_guid,
                 continue;
             }
 
-            if (tt->backend_driver == DRIVER_DCO)
+            const char *last_sep = strrchr(dev_if->device_interface, '\\');
+            if (!last_sep || strcmp(last_sep + 1, DCO_WIN_REFERENCE_STRING) != 0)
             {
-                char *last_sep = strrchr(dev_if->device_interface, '\\');
-                if (!last_sep || strcmp(last_sep + 1, DCO_WIN_REFERENCE_STRING) != 0)
-                {
-                    continue;
-                }
+                continue;
             }
 
             path = dev_if->device_interface;