mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-02-21 16:34:42 +02:00
[package] base-files: implement a generic mechanism to map per-interface sysctls to uci.
- option ipv4_xyz is mapped to /proc/sys/net/ipv4/{conf,neigh}/xyz - option ipv6_xyz is mapped to /proc/sys/net/ipv6/{conf,neigh}/xyz This allows e.g. "option ipv6_proxy_ndp 1" to enable NDP proxying on wan. Fixes ticket #8699. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27653 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
1652dbe297
commit
906ce37696
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=base-files
|
PKG_NAME:=base-files
|
||||||
PKG_RELEASE:=75
|
PKG_RELEASE:=76
|
||||||
|
|
||||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||||
PKG_BUILD_DEPENDS:=opkg/host
|
PKG_BUILD_DEPENDS:=opkg/host
|
||||||
|
@ -9,6 +9,23 @@ do_sysctl() {
|
|||||||
sysctl -n -e "$1"
|
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() {
|
find_config() {
|
||||||
local iftype device iface ifaces ifn
|
local iftype device iface ifaces ifn
|
||||||
for ifn in $interfaces; do
|
for ifn in $interfaces; do
|
||||||
@ -156,6 +173,9 @@ prepare_interface() {
|
|||||||
ifconfig "$iface" down
|
ifconfig "$iface" down
|
||||||
ifconfig "$iface" hw ether "$vifmac" up
|
ifconfig "$iface" hw ether "$vifmac" up
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Apply sysctl settings
|
||||||
|
map_sysctls "$config" "$iface"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Setup VLAN interfaces
|
# Setup VLAN interfaces
|
||||||
|
Loading…
x
Reference in New Issue
Block a user