From 42f427550121e12643c94a4707d181f189c89ab9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer <mschiffer@universe-factory.net> Date: Sat, 11 Jan 2014 13:39:09 +0100 Subject: [PATCH] Improve support for interface sysctls --- ...ge-base-files-change-sysctl-handling.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patches/openwrt/0004-package-base-files-change-sysctl-handling.patch diff --git a/patches/openwrt/0004-package-base-files-change-sysctl-handling.patch b/patches/openwrt/0004-package-base-files-change-sysctl-handling.patch new file mode 100644 index 00000000..13259e23 --- /dev/null +++ b/patches/openwrt/0004-package-base-files-change-sysctl-handling.patch @@ -0,0 +1,36 @@ +From: Matthias Schiffer <mschiffer@universe-factory.net> +Date: Sat, 11 Jan 2014 13:31:13 +0100 +Subject: package/base-files: change sysctl handling + +Move /etc/init.d/sysctl to index 00 and add hotplug script that applies +interface specific sysctls for interfaces that only appear later - this +allows to reliably configure per-interface parameters in sysctl.conf, e.g. +to disable ipv6 autoconfig on a specific iface. + +Cherry-picked from Barrier Breaker + +diff --git a/package/base-files/files/etc/hotplug.d/net/00-sysctl b/package/base-files/files/etc/hotplug.d/net/00-sysctl +new file mode 100644 +index 0000000..5d9da8a +--- /dev/null ++++ b/package/base-files/files/etc/hotplug.d/net/00-sysctl +@@ -0,0 +1,6 @@ ++#!/bin/sh ++ ++if [ -f /etc/sysctl.conf ] && [ "$ACTION" = add ]; then ++ sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" /etc/sysctl.conf | \ ++ sysctl -e -p - | logger -t sysctl ++fi +diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl +index 3480d66..beeb79f 100755 +--- a/package/base-files/files/etc/init.d/sysctl ++++ b/package/base-files/files/etc/init.d/sysctl +@@ -1,7 +1,7 @@ + #!/bin/sh /etc/rc.common + # Copyright (C) 2006 OpenWrt.org + +-START=11 ++START=0 + start() { + [ -f /etc/sysctl.conf ] && sysctl -p -e >&- + } -- GitLab