diff options
author | Loïc Minier <lool@dooz.org> | 2007-09-30 17:52:21 +0200 |
---|---|---|
committer | Loïc Minier <lool@dooz.org> | 2007-09-30 17:52:21 +0200 |
commit | cf4ac411b817a3b4630e7766562dffbc42a6525e (patch) | |
tree | f0991b3f1eb335caea4cebc6a8eb5c10d14adc58 /debian/network | |
parent | 9791e631aa3fda30c84b5f10112e162b196284b8 (diff) |
Point to vlan-interfaces(5); recommend setting vlan-raw-device
Diffstat (limited to 'debian/network')
-rw-r--r-- | debian/network/if-post-down.d/vlan | 31 | ||||
-rw-r--r-- | debian/network/if-pre-up.d/vlan | 100 |
2 files changed, 65 insertions, 66 deletions
diff --git a/debian/network/if-post-down.d/vlan b/debian/network/if-post-down.d/vlan index bbc1c44..5d3cba5 100644 --- a/debian/network/if-post-down.d/vlan +++ b/debian/network/if-post-down.d/vlan @@ -5,23 +5,24 @@ # to just probe for the right device name in /proc/net/vlan case "$IFACE" in - # Ignore any alias (#272891) - *:*) exit 0 - ;; - eth*.0*) - IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` - ;; - eth*.*) - IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` - ;; - # Test for vlan raw device (#196890, #292648) - *) [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 - ;; + # Ignore any alias (#272891) + *:*) + exit 0 + ;; + eth*.0*|bond*.0*) + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + eth*.*|bond*.*) + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + # Test for vlan raw device (#196890, #292648) + *) + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + ;; esac -if [ ! -x /sbin/vconfig ] -then - exit 0 +if [ ! -x /sbin/vconfig ]; then + exit 0 fi vconfig rem $IFACE diff --git a/debian/network/if-pre-up.d/vlan b/debian/network/if-pre-up.d/vlan index 4c8126c..8753998 100644 --- a/debian/network/if-pre-up.d/vlan +++ b/debian/network/if-pre-up.d/vlan @@ -3,61 +3,59 @@ # Most of this stuff is to enable vlans case "$IFACE" in - # Ignore any alias (#272891) which uses <interface>:<alabel> - *:*) exit 0 - ;; - vlan0*) - vconfig set_name_type VLAN_PLUS_VID - VLANID=`echo $IFACE|sed "s/vlan0*//"` - ;; - vlan*) - vconfig set_name_type VLAN_PLUS_VID_NO_PAD - VLANID=`echo $IFACE|sed "s/vlan0*//"` - ;; - eth*.0*) - vconfig set_name_type DEV_PLUS_VID - VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"` - IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` - ;; - eth*.*) - vconfig set_name_type DEV_PLUS_VID_NO_PAD - VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"` - IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"` - ;; - *.0*) - # Silently ignore interfaces which we do not (know how to) support - [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 - vconfig set_name_type DEV_PLUS_VID - VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` - ;; - *.*) - # Silently ignore interfaces which we do not (know how to) support - [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 - vconfig set_name_type DEV_PLUS_VID_NO_PAD - VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` - ;; + # Ignore any alias (#272891) which uses <interface>:<alabel> + *:*) + exit 0 + ;; + vlan0*) + vconfig set_name_type VLAN_PLUS_VID + VLANID=`echo $IFACE|sed "s/vlan0*//"` + ;; + vlan*) + vconfig set_name_type VLAN_PLUS_VID_NO_PAD + VLANID=`echo $IFACE|sed "s/vlan0*//"` + ;; + eth*.0*|bond*.0*) + vconfig set_name_type DEV_PLUS_VID + VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//"` + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + eth*.*|bond*.*) + vconfig set_name_type DEV_PLUS_VID_NO_PAD + VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//g"` + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/"` + ;; + *.0*) + # Silently ignore interfaces which we do not (know how to) support + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + vconfig set_name_type DEV_PLUS_VID + VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` + ;; + *.*) + # Silently ignore interfaces which we do not (know how to) support + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + vconfig set_name_type DEV_PLUS_VID_NO_PAD + VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"` + ;; - *) exit 0 - ;; + *) + exit 0 + ;; esac -if [ -n "$IF_VLAN_RAW_DEVICE" ] -then - if [ ! -x /sbin/vconfig ] - then - exit 0 - fi - if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null - then - echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE" - exit 1 - fi - ip link set up dev $IF_VLAN_RAW_DEVICE - vconfig add $IF_VLAN_RAW_DEVICE $VLANID +if [ -n "$IF_VLAN_RAW_DEVICE" ]; then + if [ ! -x /sbin/vconfig ]; then + exit 0 + fi + if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null; then + echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE" + exit 1 + fi + ip link set up dev $IF_VLAN_RAW_DEVICE + vconfig add $IF_VLAN_RAW_DEVICE $VLANID fi # This is not vlan specific, and should actually go somewhere else. -if [ -n "$IF_HW_MAC_ADDRESS" ] -then - ip link set $IFACE address $IF_HW_MAC_ADDRESS +if [ -n "$IF_HW_MAC_ADDRESS" ]; then + ip link set $IFACE address $IF_HW_MAC_ADDRESS fi |