my private gentoo overlay
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

From 20a63ad8a90c36397cceedd34887298890dbafa3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 11 Mar 2016 10:38:10 +0100
Subject: [PATCH] Linux: Do not open conntracking table if masquerading is not
enabled
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The contracking table was always opened. This is unnecessary because
the table is used only when masquerading feature is requested on run
time.
This patch skips opening the conntracking table on Linux if
masquerading is not requested.
https://bugzilla.redhat.com/show_bug.cgi?id=1316308
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
src/kernel/linux.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/kernel/linux.c b/src/kernel/linux.c
index 9103dbf..859f554 100644
--- a/src/kernel/linux.c
+++ b/src/kernel/linux.c
@@ -70,6 +70,11 @@ bool netfilter;
*/
bool core_init(void) {
#ifdef MASQ_SUPPORT
+ if (!opt_enabled(MASQ)) {
+ masq_fp = NULL;
+ return true;
+ }
+
masq_fp = fopen(MASQFILE, "r");
if (masq_fp == NULL) {
if (errno != ENOENT) {
--
2.5.0