network: fix vlan handling

master
Harald Hoyer 2017-01-18 12:56:26 +01:00
parent a1595cf5f9
commit 0cf826a11a
4 changed files with 17 additions and 10 deletions

View File

@ -149,7 +149,9 @@ if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then

for i in /tmp/vlan.*.${netif}; do
[ -e "$i" ] || continue
read vlanname < "$i"
unset vlanname
unset phydevice
. "$i"
if [ -n "$vlanname" ]; then
linkup "$phydevice"
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)"

View File

@ -41,15 +41,15 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
MASTER_IFACES="$MASTER_IFACES ${teammaster}"
done

for j in /tmp/vlan.*.phy; do
[ -e "$j" ] || continue
for i in /tmp/vlan.*.phy; do
[ -e "$i" ] || continue
unset phydevice
. "$j"
for i in /tmp/vlan.*.${phydevice}; do
[ -e "$i" ] || continue
. "$i"
RAW_IFACES="$RAW_IFACES $phydevice"
for j in /tmp/vlan.*.${phydevice}; do
[ -e "$j" ] || continue
unset vlanname
. "$i"
RAW_IFACES="$RAW_IFACES $phydevice"
. "$j"
MASTER_IFACES="$MASTER_IFACES ${vlanname}"
done
done

View File

@ -26,6 +26,9 @@ for vlan in $(getargs vlan=); do
parsevlan "$(getarg vlan=)"
fi

echo "$phydevice" > /tmp/vlan.${phydevice}.phy
echo "$vlanname" > /tmp/vlan.${vlanname}.${phydevice}
echo "phydevice=\"$phydevice\"" > /tmp/vlan.${phydevice}.phy
{
echo "vlanname=\"$vlanname\""
echo "phydevice=\"$phydevice\""
} > /tmp/vlan.${vlanname}.${phydevice}
done

View File

@ -132,6 +132,8 @@ for netup in /tmp/net.*.did-setup ; do
unset slave
unset ethname
unset vlan
unset vlanname
unset phydevice

[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
[ -e /tmp/bridge.${netif}.info ] && . /tmp/bridge.${netif}.info