[network-manager-pptp/jk/pptp-nf_conntrack_pptp] service: try to load nf_conntrack_pptp kernel module (rh #1214643)



commit cc02f31f74b7019b4435ec8deb1e698c2b2f4cfd
Author: Jiří Klimeš <jklimes redhat com>
Date:   Fri Apr 17 16:54:49 2015 +0200

    service: try to load nf_conntrack_pptp kernel module (rh #1214643)
    
    The module is necessary with newer kernels so that PPTP work correctly.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1214643
    https://bugzilla.redhat.com/show_bug.cgi?id=1187328

 src/nm-pptp-service.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
index 28f3313..9d11769 100644
--- a/src/nm-pptp-service.c
+++ b/src/nm-pptp-service.c
@@ -1313,6 +1313,8 @@ main (int argc, char *argv[])
        GMainLoop *main_loop;
        gboolean persist = FALSE;
        GOptionContext *opt_ctx = NULL;
+       char *conntrack_module[] = { "/sbin/modprobe", "nf_conntrack_pptp", NULL };
+       GError *error = NULL;
 
        GOptionEntry options[] = {
                { "persist", 0, 0, G_OPTION_ARG_NONE, &persist, N_("Don't quit when VPN connection 
terminates"), NULL },
@@ -1359,6 +1361,14 @@ main (int argc, char *argv[])
        if (!persist)
                g_signal_connect (plugin, "quit", G_CALLBACK (quit_mainloop), main_loop);
 
+       /* Newer kernels require nf_conntrack_pptp kernel module so that PPTP
+        * works correctly. Load the module now. Ignore errors, the module
+        * might not exist (older kernels).
+        * https://bugzilla.redhat.com/show_bug.cgi?id=1187328
+        */
+       if (!g_spawn_sync (NULL, conntrack_module, NULL, 0, NULL, NULL, NULL, NULL, NULL, &error))
+               g_warning ("modprobing nf_conntrack_pptp failed: %s", error->message);
+
        g_main_loop_run (main_loop);
 
        g_main_loop_unref (main_loop);


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