Re: [PATCH 1/1] service: only attempt to load the 'tun' modules if necessary
On Fri, 2014-07-04 at 16:27 +0200, Thomas Haller wrote: 'tun' support might be compiled into the kernel, thus modprobe will always fail. https://mail.gnome.org/archives/networkmanager-list/2014-July/msg00014.html Signed-off-by: Thomas Haller thal...@redhat.com Looks good to me. Dan --- src/nm-openvpn-service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 (); ___ networkmanager-list mailing list networkmanager-list@gnome.org https://mail.gnome.org/mailman/listinfo/networkmanager-list
RE: [PATCH 1/1] service: only attempt to load the 'tun' modules if necessary
-Original Message- From: Thomas Haller [mailto:thal...@redhat.com] Sent: Friday, 04 July, 2014 18:28 To: networkmanager-list@gnome.org; Bastien Nocera Cc: John Frankish; Thomas Haller Subject: [PATCH 1/1] 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 Signed-off-by: Thomas Haller thal...@redhat.com --- src/nm-openvpn-service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 (); -- 1.9.3 Everything works fine now :) Thanks ___ networkmanager-list mailing list networkmanager-list@gnome.org https://mail.gnome.org/mailman/listinfo/networkmanager-list