79dacd0
From 30353eb466fe1ef768dc7bc1ccc1239b97dab70c Mon Sep 17 00:00:00 2001
0f2f0b4
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
0f2f0b4
Date: Tue, 7 Oct 2014 01:49:10 -0400
0f2f0b4
Subject: [PATCH] fedora: add bridge sysctl configuration
0f2f0b4
0f2f0b4
Udev rule is added to load those settings when the bridge
0f2f0b4
module is loaded.
0f2f0b4
0f2f0b4
https://bugzilla.redhat.com/show_bug.cgi?id=634736
0f2f0b4
---
0f2f0b4
 Makefile.am              | 8 ++++++--
0f2f0b4
 rules/.gitignore         | 1 +
0f2f0b4
 rules/99-bridge.rules.in | 9 +++++++++
0f2f0b4
 sysctl.d/50-bridge.conf  | 4 ++++
0f2f0b4
 4 files changed, 20 insertions(+), 2 deletions(-)
0f2f0b4
 create mode 100644 rules/99-bridge.rules.in
0f2f0b4
 create mode 100644 sysctl.d/50-bridge.conf
0f2f0b4
0f2f0b4
diff --git a/Makefile.am b/Makefile.am
0f2f0b4
index e52db1793b..41e94575ef 100644
0f2f0b4
--- a/Makefile.am
0f2f0b4
+++ b/Makefile.am
0f2f0b4
@@ -445,7 +445,8 @@ CLEANFILES += \
0f2f0b4
 	$(nodist_zshcompletion_DATA)
0f2f0b4
 
0f2f0b4
 dist_sysctl_DATA = \
0f2f0b4
-	sysctl.d/50-default.conf
0f2f0b4
+	sysctl.d/50-default.conf \
0f2f0b4
+	sysctl.d/50-bridge.conf
0f2f0b4
 
0f2f0b4
 dist_systemunit_DATA = \
0f2f0b4
 	units/graphical.target \
0f2f0b4
@@ -3281,7 +3282,8 @@ dist_udevrules_DATA += \
0f2f0b4
 	rules/95-udev-late.rules
0f2f0b4
 
0f2f0b4
 nodist_udevrules_DATA += \
0f2f0b4
-	rules/99-systemd.rules
0f2f0b4
+	rules/99-systemd.rules \
0f2f0b4
+	rules/99-bridge.rules
0f2f0b4
 
0f2f0b4
 dist_udevhwdb_DATA = \
0f2f0b4
 	hwdb/20-pci-vendor-model.hwdb \
0f2f0b4
@@ -3306,10 +3308,12 @@ sharepkgconfig_DATA = \
0f2f0b4
 
0f2f0b4
 EXTRA_DIST += \
0f2f0b4
 	rules/99-systemd.rules.in \
0f2f0b4
+	rules/99-bridge.rules.in \
0f2f0b4
 	src/udev/udev.pc.in
0f2f0b4
 
0f2f0b4
 CLEANFILES += \
0f2f0b4
 	rules/99-systemd.rules \
0f2f0b4
+	rules/99-bridge.rules \
0f2f0b4
 	src/udev/udev.pc
0f2f0b4
 
0f2f0b4
 EXTRA_DIST += \
0f2f0b4
diff --git a/rules/.gitignore b/rules/.gitignore
0f2f0b4
index 93a50ddd80..46c7f3ce91 100644
0f2f0b4
--- a/rules/.gitignore
0f2f0b4
+++ b/rules/.gitignore
0f2f0b4
@@ -1 +1,2 @@
0f2f0b4
 /99-systemd.rules
0f2f0b4
+/99-bridge.rules
0f2f0b4
diff --git a/rules/99-bridge.rules.in b/rules/99-bridge.rules.in
0f2f0b4
new file mode 100644
0f2f0b4
index 0000000000..f46f96bd2e
0f2f0b4
--- /dev/null
0f2f0b4
+++ b/rules/99-bridge.rules.in
0f2f0b4
@@ -0,0 +1,9 @@
0f2f0b4
+#  This file is part of systemd.
0f2f0b4
+#
0f2f0b4
+#  systemd is free software; you can redistribute it and/or modify it
0f2f0b4
+#  under the terms of the GNU Lesser General Public License as published by
0f2f0b4
+#  the Free Software Foundation; either version 2.1 of the License, or
0f2f0b4
+#  (at your option) any later version.
0f2f0b4
+
0f2f0b4
+# Apply sysctl settings to bridges
0f2f0b4
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="@rootlibexecdir@/systemd-sysctl --prefix=/net/bridge"
0f2f0b4
diff --git a/sysctl.d/50-bridge.conf b/sysctl.d/50-bridge.conf
0f2f0b4
new file mode 100644
0f2f0b4
index 0000000000..b586bf15fa
0f2f0b4
--- /dev/null
0f2f0b4
+++ b/sysctl.d/50-bridge.conf
0f2f0b4
@@ -0,0 +1,4 @@
0f2f0b4
+# Disable netfilter on bridges.
0f2f0b4
+net.bridge.bridge-nf-call-ip6tables = 0
0f2f0b4
+net.bridge.bridge-nf-call-iptables = 0
0f2f0b4
+net.bridge.bridge-nf-call-arptables = 0