[network-manager-openvpn] service: only attempt to load the 'tun' modules if necessary



commit a7413d300199697dc3e9c3d2ea50eb5163cb8f91
Author: Thomas Haller <thaller redhat com>
Date:   Fri Jul 4 16:27:53 2014 +0200

    service: only attempt to load the 'tun' modules if necessary
    
    'tun' support might be compiled into the kernel, thus modprobe will
    always fail.
    
    https://mail.gnome.org/archives/networkmanager-list/2014-July/msg00014.html
    
    Acked-by: Dan Williams <dcbw redhat com>
    Signed-off-by: Thomas Haller <thaller redhat com>

 src/nm-openvpn-service.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 84968e8..b45eb28 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1623,7 +1623,8 @@ main (int argc, char *argv[])
        if (debug)
                g_message ("nm-openvpn-service (version " DIST_VERSION ") starting...");
 
-       if (system ("/sbin/modprobe tun") == -1)
+       if (   !g_file_test ("/sys/class/misc/tun", G_FILE_TEST_EXISTS)
+           && (system ("/sbin/modprobe tun") == -1))
                exit (EXIT_FAILURE);
 
        plugin = nm_openvpn_plugin_new ();


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