summaryrefslogtreecommitdiff
path: root/package/base-files-network/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-03-13 12:25:28 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-03-13 12:25:28 +0000
commit95edc71814e0e94ecf347f86f1cb5c87c90be676 (patch)
treeb4776eb2612c8e78d278e9cedacdd74938bc7773 /package/base-files-network/files
parentdce6ee5830d79c038011ade15b970448a8215a3c (diff)
downloadmtk-20170518-95edc71814e0e94ecf347f86f1cb5c87c90be676.zip
mtk-20170518-95edc71814e0e94ecf347f86f1cb5c87c90be676.tar.gz
mtk-20170518-95edc71814e0e94ecf347f86f1cb5c87c90be676.tar.bz2
base-files-network: configure vlan interface name type immediately before the vconfig add calls, fixes race condition (#11127)
SVN-Revision: 30919
Diffstat (limited to 'package/base-files-network/files')
-rwxr-xr-xpackage/base-files-network/files/lib/network/config.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/package/base-files-network/files/lib/network/config.sh b/package/base-files-network/files/lib/network/config.sh
index feeaa2f..a58ab1e 100755
--- a/package/base-files-network/files/lib/network/config.sh
+++ b/package/base-files-network/files/lib/network/config.sh
@@ -83,6 +83,7 @@ add_vlan() {
[ "$1" = "$vif" ] || ifconfig "$1" >/dev/null 2>/dev/null || {
ifconfig "$vif" up 2>/dev/null >/dev/null || add_vlan "$vif"
+ $DEBUG vconfig set_name_type DEV_PLUS_VID_NO_PAD
$DEBUG vconfig add "$vif" "${1##*\.}"
return 0
}
@@ -218,7 +219,8 @@ prepare_interface() {
$DEBUG brctl addif "br-$config" "$iface"
$DEBUG brctl stp "br-$config" $stp
[ -z "$macaddr" ] && macaddr="$(cat /sys/class/net/$iface/address)"
- echo $igmp_snooping > /sys/devices/virtual/net/br-$config/bridge/multicast_snooping 2>/dev/null
+ [ -e /sys/devices/virtual/net/br-$config/bridge/multicast_snooping ] && \
+ echo $igmp_snooping > /sys/devices/virtual/net/br-$config/bridge/multicast_snooping
$DEBUG ifconfig "br-$config" hw ether $macaddr up
# Creating the bridge here will have triggered a hotplug event, which will
# result in another setup_interface() call, so we simply stop processing