anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0172-kmod-setup-load-ip_tables-kmod-at-boot.patch

1ff636
From 6df5513d294ae368f2a09fb47917e11048347885 Mon Sep 17 00:00:00 2001
1ff636
From: Lennart Poettering <lennart@poettering.net>
1ff636
Date: Wed, 22 Apr 2015 13:50:56 +0200
1ff636
Subject: [PATCH] kmod-setup: load ip_tables kmod at boot
1ff636
1ff636
The module is currently no auto-loadable (and this is unlikely to change
1ff636
anytime soon, given it's API is via getsockopt/setsockopt). It is needed
1ff636
by networkd and nspawn currently.
1ff636
1ff636
Users who really don't like the module to be loaded have the option to
1ff636
blacklist it still, or not compile it at all. But for all others this
1ff636
should make things work out-of-the-box.
1ff636
1ff636
(cherry picked from commit 1d3087978a8ee23107cb64aa55ca97aefe9531e2)
1ff636
1ff636
Cherry-picked from: f801bf8
1ff636
Resolves: #1222517
1ff636
---
1ff636
 src/core/kmod-setup.c | 11 +++++++----
1ff636
 1 file changed, 7 insertions(+), 4 deletions(-)
1ff636
1ff636
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
181b3f
index c0a05b97a..97f3b9b34 100644
1ff636
--- a/src/core/kmod-setup.c
1ff636
+++ b/src/core/kmod-setup.c
1ff636
@@ -63,16 +63,19 @@ int kmod_setup(void) {
1ff636
                 bool (*condition_fn)(void);
1ff636
         } kmod_table[] = {
1ff636
                 /* auto-loading on use doesn't work before udev is up */
1ff636
-                { "autofs4", "/sys/class/misc/autofs", true, NULL                 },
1ff636
+                { "autofs4",   "/sys/class/misc/autofs",    true,  NULL                },
1ff636
 
1ff636
                 /* early configure of ::1 on the loopback device */
1ff636
-                { "ipv6",    "/sys/module/ipv6",       true, NULL                 },
1ff636
+                { "ipv6",      "/sys/module/ipv6",          true,  NULL                },
1ff636
 
1ff636
                 /* this should never be a module */
1ff636
-                { "unix",    "/proc/net/unix",         true, NULL                 },
1ff636
+                { "unix",      "/proc/net/unix",            true,  NULL                },
1ff636
 
1ff636
                 /* IPC is needed before we bring up any other services */
1ff636
-                { "kdbus",   "/sys/fs/kdbus",          false, cmdline_check_kdbus },
1ff636
+                { "kdbus",     "/sys/fs/kdbus",             false, cmdline_check_kdbus },
1ff636
+
1ff636
+                /* netfilter is needed by networkd, nspawn among others, and cannot be autoloaded */
1ff636
+                { "ip_tables", "/proc/net/ip_tables_names", false, NULL                },
1ff636
         };
1ff636
         struct kmod_ctx *ctx = NULL;
1ff636
         unsigned int i;