summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2006-07-16 15:09:59 +0200
committerWilly Tarreau <willy@wtap.(none)>2006-07-26 12:03:42 +0200
commit3ac47ed0017e6ebeab1f80d33f5b08d36b7df6d2 (patch)
treef758e61ad918d721329c37f64aae8a411833a6c9
parent[RELEASE] init-scripts-0.3.26 (diff)
downloadinit-scripts-0.3.27.tar.gz
[RELEASE] init-scripts-0.3.27v0.3.27
-rw-r--r--ChangeLog3
-rwxr-xr-xsbin/init.d/network29
2 files changed, 28 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 4909eab..321ec58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2003/11/12 : 0.3.27
+- network : native use of vlan interfaces. Simply declare an interface with a
+ name like "eth1.146" to create vlan 146 on eth1
2003/11/11 : 0.3.26
- functions : fixed stupid bug with uninitialized variable in list_options
- system : added a help function
diff --git a/sbin/init.d/network b/sbin/init.d/network
index 7e6714b..d138b2c 100755
--- a/sbin/init.d/network
+++ b/sbin/init.d/network
@@ -181,6 +181,20 @@ function do_start {
arg=$[$arg+1]
done
+ # a dot in an interface name means physical_if.vlanid
+ # We have to create the interface now.
+ if [ -z "${instname//*.*/}" ]; then
+ arg=${instname%%.*}
+ if ! do_status $svcname $arg && ! do_start $svcname $arg >/dev/null 2>&1; then
+ echo " ==> FAILED! could not start slave $arg before $instname"
+ fi
+ vconfig add $arg ${instname#*.} >/dev/null
+ if [ $? -gt 0 ]; then
+ echo " ==> start $svcname${instname:+[$instname]} : Failed."
+ return 1
+ fi
+ fi
+
ip addr flush dev $instname >/dev/null 2>&1
ip link set $instname down >/dev/null 2>&1
@@ -220,8 +234,8 @@ function do_start {
if [ ${#opt_slave[*]} -gt 0 ]; then
for arg in ${opt_slave[*]}; do
- if ! $PFULLNAME status $arg >/dev/null 2>&1; then
- echo " ==> FAILED! need to start slave $arg before $instname"
+ if ! do_status $svcname $arg && ! do_start $svcname $arg >/dev/null 2>&1; then
+ echo " ==> FAILED! need to start slave $arg before $instname"
else
ifenslave $instname $arg >/dev/null 2>&1
ip addr flush dev $arg >/dev/null 2>&1
@@ -307,8 +321,11 @@ function do_stop {
echo "# Stopping $svcname${instname:+[$instname]} ..."
if ! do_status $svcname $instname > /dev/null 2>&1; then
- echo " ==> stop $svcname${instname:+[$instname]} : already stopped."
- return 0
+ # vlan interfaces must disappear
+ if [ -n "${instname//*.*/}" ] || ! ip link show $instname >/dev/null 2>&1; then
+ echo " ==> stop $svcname${instname:+[$instname]} : already stopped."
+ return 0
+ fi
fi
# we may have to kill dhcpcd
@@ -326,6 +343,10 @@ function do_stop {
ip addr flush dev $instname >/dev/null 2>&1
ip link set $instname down >/dev/null 2>&1
+ # a dot in an interface name means physical_if.vlanid
+ # We have to remove the interface now.
+ [ -z "${instname//*.*/}" ] && vconfig rem $instname >/dev/null
+
arg=${#opt_modprobe[*]}
while [ $arg -gt 0 ]; do
arg=$[$arg-1]