[NetworkManager-openvpn/wip/ernestask/allow-compression: 7/9] Add logic to detect OpenVPN <=2.4




commit c78420fb6c04e1a83904cede08e57460aaf3ded6
Author: Ernestas Kulik <ernestas@baltic.engineering>
Date:   Sun Aug 28 10:44:56 2022 +0300

    Add logic to detect OpenVPN <=2.4
    
    Things like allow-compression are only supported it 2.4+, but there is
    currently no way to detect it.

 src/nm-openvpn-service.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 3731e89..cb9d01d 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -89,6 +89,7 @@ typedef enum {
        OPENVPN_BINARY_VERSION_INVALID,
        OPENVPN_BINARY_VERSION_UNKNOWN,
        OPENVPN_BINARY_VERSION_2_3_OR_OLDER,
+       OPENVPN_BINARY_VERSION_2_4_OR_OLDER,
        OPENVPN_BINARY_VERSION_2_4_OR_NEWER,
 } OpenvpnBinaryVersion;
 
@@ -576,6 +577,9 @@ openvpn_binary_detect_version (const char *exepath)
 
        if (n <= 3)
                return OPENVPN_BINARY_VERSION_2_3_OR_OLDER;
+       if (n <= 4)
+               return OPENVPN_BINARY_VERSION_2_4_OR_OLDER;
+
        return OPENVPN_BINARY_VERSION_2_4_OR_NEWER;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]