From 286e6430ce2b1873e319e5edfa08c45806fbedab Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 12 May 2010 14:00:11 +0200 Subject: use ip command for vlan instead of vconfig --- sysconfig/network-scripts/ifdown-eth | 4 ++-- sysconfig/network-scripts/ifup | 28 ++++++---------------------- 2 files changed, 8 insertions(+), 24 deletions(-) (limited to 'sysconfig/network-scripts') diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index 1ca6a6f2..53c70238 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -138,12 +138,12 @@ if [ "$retcode" = 0 ] ; then # the interface went down. fi -if [ -n "$VLAN" -a -x /sbin/vconfig ]; then +if [ -n "$VLAN" ]; 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]?' \ || 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} + ip link delete ${DEVICE} type vlan } fi fi diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index ffbd376d..c15d1d2a 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -71,7 +71,7 @@ if [ "$USE_NM" = "true" -a -n "$UUID" ]; then fi # Ethernet 802.1Q VLAN support -if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then +if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ]; then VID="" MATCH='^(eth|hsi|bond)[0-9]+\.[0-9]{1,4}$' if [[ "${DEVICE}" =~ $MATCH ]]; then @@ -96,9 +96,6 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then fi 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." - } is_available ${PHYSDEV} || { if [ "$?" = "1" ] ; then @@ -115,30 +112,17 @@ if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then } if [ ! -f /proc/net/vlan/${DEVICE} ]; then - /sbin/vconfig add ${PHYSDEV} ${VID} || { + if [ "${REORDER_HDR}" = "no" -o "${REORDER_HDR}" = "0" ]; then + FLAG_REORDER_HDR="reorder_hdr off" + fi + + ip link add dev ${DEVICE} link ${PHYSDEV} type vlan id ${VID} ${FLAG_REORDER_HDR} || { (/usr/bin/logger -p daemon.info -t ifup \ $"ERROR: could not add vlan ${VID} as ${DEVICE} on dev ${PHYSDEV}" &)& echo $"ERROR: could not add vlan ${VID} as ${DEVICE} on dev ${PHYSDEV}" exit 1 } fi - - if [ -f /proc/net/vlan/${DEVICE} ]; then - case "$REORDER_HDR" in - yes|1) - /sbin/vconfig set_flag ${DEVICE} 1 1 || { - (/usr/bin/logger -p daemon.info -t ifup \ - "WARNING: vconfig not able to enable REORDER_HDR on ${DEVICE}" &)& - } - ;; - no|0) - /sbin/vconfig set_flag ${DEVICE} 1 0 || { - (/usr/bin/logger -p daemon.info -t ifup \ - $"WARNING: vconfig not able to disable REORDER_HDR on ${DEVICE}" &)& - } - ;; - esac - fi fi fi -- cgit v1.2.1