[backfire] merge r27653
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 17 Jul 2011 17:22:12 +0000 (17:22 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 17 Jul 2011 17:22:12 +0000 (17:22 +0000)
SVN-Revision: 27654

package/base-files/Makefile
package/base-files/files/lib/network/config.sh

index 6aaf1db6b376b023d10d1ce58148cfae08a18fb7..8f9dea97011c56bb9a7d0cc9c70220984d3ceebc 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=43.22
+PKG_RELEASE:=43.23
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
index c4d24f119009a6052ecdb570714b35ea593fcf9c..76a4e23aa67ef7af903e5465781bfd5759bc09a6 100755 (executable)
@@ -9,6 +9,23 @@ do_sysctl() {
                sysctl -n -e "$1"
 }
 
+map_sysctls() {
+       local cfg="$1"
+       local ifn="$2"
+
+       local fam
+       for fam in ipv4 ipv6; do
+               if [ -d /proc/sys/net/$fam ]; then
+                       local key
+                       for key in /proc/sys/net/$fam/*/$ifn/*; do
+                               local val
+                               config_get val "$cfg" "${fam}_${key##*/}"
+                               [ -n "$val" ] && echo -n "$val" > "$key"
+                       done
+               fi
+       done
+}
+
 find_config() {
        local iftype device iface ifaces ifn
        for ifn in $interfaces; do
@@ -156,6 +173,9 @@ prepare_interface() {
                        ifconfig "$iface" down
                        ifconfig "$iface" hw ether "$vifmac" up
                }
+
+               # Apply sysctl settings
+               map_sysctls "$config" "$iface"
        }
 
        # Setup VLAN interfaces