aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifup37
1 files changed, 22 insertions, 15 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 278fde39..072b03f6 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -75,21 +75,28 @@ if [ "$_use_nm" = "true" -a -n "$UUID" ]; then
fi
# Ethernet 802.1Q VLAN support
-if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ]; then
- VID=""
- MATCH='^.+\.[0-9]{1,4}$'
- if [[ "${DEVICE}" =~ $MATCH ]]; then
- VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^.*\.\([0-9]\+\)/\1/')
- PHYSDEV=${DEVICE%.*}
- fi
- MATCH='^vlan[0-9]{1,4}?'
- if [[ "${DEVICE}" =~ $MATCH ]]; then
- VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^vlan0*//')
- # PHYSDEV should be set in ifcfg-vlan* file
- if test -z "$PHYSDEV"; then
- net_log $"PHYSDEV should be set for device ${DEVICE}"
- exit 1
- fi
+if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ] && [ -n $DEVICE ]; then
+ if [ -n ${VID} ]; then
+ if test -z "$PHYSDEV"; then
+ net_log $"PHYSDEV should be set for device ${DEVICE}"
+ exit 1
+ fi
+ else
+ VID=""
+ MATCH='^.+\.[0-9]{1,4}$'
+ if [[ "${DEVICE}" =~ $MATCH ]]; then
+ VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^.*\.\([0-9]\+\)/\1/')
+ PHYSDEV=${DEVICE%.*}
+ fi
+ MATCH='^vlan[0-9]{1,4}?'
+ if [[ "${DEVICE}" =~ $MATCH ]]; then
+ VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^vlan0*//'):
+ # PHYSDEV should be set in ifcfg-vlan* file
+ if test -z "$PHYSDEV"; then
+ net_log $"PHYSDEV should be set for device ${DEVICE}"
+ exit 1
+ fi
+ fi
fi
if [ -n "$VID" ]; then
if [ ! -d /proc/net/vlan ]; then