aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-03-30 16:51:16 +0000
committerBill Nottingham <notting@redhat.com>2005-03-30 16:51:16 +0000
commit9327025d435c81b2fb622de13b22fe12b1941a4e (patch)
treeac368d52eba18c3eea03b99be69c7670736a9bca /sysconfig
parent109d84ebd3e7ff4286812d278eb86ef5ff204a3a (diff)
downloadinitscripts-9327025d435c81b2fb622de13b22fe12b1941a4e.tar
initscripts-9327025d435c81b2fb622de13b22fe12b1941a4e.tar.gz
initscripts-9327025d435c81b2fb622de13b22fe12b1941a4e.tar.bz2
initscripts-9327025d435c81b2fb622de13b22fe12b1941a4e.tar.xz
initscripts-9327025d435c81b2fb622de13b22fe12b1941a4e.zip
handle alternate vlan naming schemes (#115001)
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifdown3
-rwxr-xr-xsysconfig/network-scripts/ifup28
2 files changed, 22 insertions, 9 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 3b97a4c6..4242baab 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -123,7 +123,8 @@ fi
if [ -n "$VLAN" -a -x /sbin/vconfig ]; then
# 802.1q VLAN
- if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then
+ if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' \
+ || echo ${DEVICE} | LANG=C egrep -q 'vlan[0-9][0-9]?[0-9]?[0-9]?' ; then
[ -f /proc/net/vlan/${DEVICE} ] && {
/sbin/vconfig rem ${DEVICE}
}
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 17ad0804..7bd2ce01 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -55,10 +55,28 @@ fi
# Ethernet 802.1Q VLAN support
if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then
- if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' ; then
+ VID=""
+ if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?'; then
+ VID="`echo ${DEVICE} | \
+ LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
+ LANG=C sed 's/^[a-z0-9]*\.//g;s/^0*//'`"
+ PHYSDEV="`echo ${DEVICE} | \
+ LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
+ LANG=C sed 's/\.[a-z0-9]*$//g'`"
+ fi
+ if echo ${DEVICE} | LANG=C egrep -q 'vlan[0-9][0-9]?[0-9]?[0-9]?'; then
+ VID="`echo ${DEVICE} | LANG=C sed 's/^vlan//;s/^0*//'`"
+ # PHYSDEV should be set in ifcfg-vlan* file
+ if test -z "$PHYSDEV"; then
+ echo $"PHYSDEV should be set for device ${DEVICE}"
+ exit 1
+ fi
+ fi
+ if [ -n "$VID" ]; then
if [ ! -d /proc/net/vlan ]; then
if modprobe 8021q >/dev/null 2>&1 ; then
- /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD >/dev/null 2>&1 || {
+ test -z "$VLAN_NAME_TYPE" && VLAN_NAME_TYPE=DEV_PLUS_VID_NO_PAD
+ /sbin/vconfig set_name_type "$VLAN_NAME_TYPE" >/dev/null 2>&1 || {
echo $"Could not set 802.1Q VLAN parameters."
}
else
@@ -66,12 +84,6 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" ]; then
exit 1
fi
fi
- VID="`echo ${DEVICE} | \
- LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
- LANG=C sed 's/^[a-z0-9]*\.//g;s/^0*//'`"
- PHYSDEV="`echo ${DEVICE} | \
- LANG=C egrep '(eth|bond)[0-9]+\.[0-9][0-9]?[0-9]?[0-9]?$' | \
- LANG=C sed 's/\.[a-z0-9]*$//g'`"
is_available ${PHYSDEV} || {
if [ "$?" = "1" ] ; then