aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-06-01 18:07:44 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-06-01 18:07:44 +0000
commit7898f9a59d0fd33162b90b82dc435ec20b3cd068 (patch)
tree12741e45ccede407b21ff8ebd4fcea6bba92db93 /package/base-files
parent09931003762a0adb80f6939e5fdcae17e52b366d (diff)
downloadmaster-187ad058-7898f9a59d0fd33162b90b82dc435ec20b3cd068.tar.gz
master-187ad058-7898f9a59d0fd33162b90b82dc435ec20b3cd068.tar.bz2
master-187ad058-7898f9a59d0fd33162b90b82dc435ec20b3cd068.zip
network: do not unnecessarily touch interfaces configured as proto=none; bring down old aliases before setting up new ones
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16266 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index d0aa33d1a4..808463df52 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -84,6 +84,7 @@ prepare_interface() {
local iface="$1"
local config="$2"
local vifmac="$3"
+ local proto
# if we're called for the bridge interface itself, don't bother trying
# to create any interfaces here. The scripts have already done that, otherwise
@@ -91,9 +92,12 @@ prepare_interface() {
[ "br-$config" = "$iface" -o -e "$iface" ] && return 0;
ifconfig "$iface" 2>/dev/null >/dev/null && {
- # make sure the interface is removed from any existing bridge and deconfigured
- ifconfig "$iface" 0.0.0.0
+ config_get proto "$config" proto
+
+ # make sure the interface is removed from any existing bridge and deconfigured,
+ # (deconfigured only if the interface is not set to proto=none)
unbridge "$iface"
+ [ "$proto" = none ] || ifconfig "$iface" 0.0.0.0
# Change interface MAC address if requested
[ -n "$vifmac" ] && {
@@ -287,6 +291,11 @@ setup_interface() {
fi
;;
esac
+ [ "$proto" = none ] || {
+ for ifn in `ifconfig | grep "^$iface:" | awk '{print $1}'`; do
+ ifconfig "$ifn" down
+ done
+ }
config_set "$config" aliases ""
config_set "$config" alias_count 0
config_foreach setup_interface_alias alias "$config" "$iface"