]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- apply SOURCES/rc-scripts-dev_alias.patch
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 26 Nov 2007 20:37:27 +0000 (20:37 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Mon, 26 Nov 2007 20:37:27 +0000 (20:37 +0000)
  (if it is buggy then the bugs should be fixed -- it's been applied in pld ac for ages)

svn-id: @9102

sysconfig/network-scripts/functions.network
sysconfig/network-scripts/ifdown
sysconfig/network-scripts/ifup

index 9363d0ad420632c5891f3c077aec548e81f034a7..9137045e451aa91b9497c63eed12be0ca9a75a58 100644 (file)
@@ -189,7 +189,7 @@ setup_ip_param ()
 {
        # detect network device type (ie. dummy, eth for dummy0, eth0 ..)
        if [ -z "$DEVICETYPE" ]; then
-               DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[0-9]*\.?[0-9]*$/,NUL); print $0 } ')
+               DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[\.:]?[0-9]*[\.:]?[0-9]*$/,NUL); print $0 } ')
        fi
 
        # Setup DEVICETYPE for special cases.
@@ -198,6 +198,7 @@ setup_ip_param ()
        fi
 
        # real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias)
+       SUBDEVICE=$(echo "$DEVICE" | egrep "([0-9]+:[0-9]+)" )
        DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ')
 
        eval IP4ADDR="\$IPADDR${IP4_PRIM_IF:-}"
index 51160e75c8333966dde18b736d3372399c63a8de..6d69d06b6cf566db8ca9213dde7779a53ce9502f 100755 (executable)
@@ -120,8 +120,12 @@ if is_yes $ETH_VLANS && $(echo $DEVICE | grep -q ^eth) ; then
                ip link set ${DEVICE} down
        fi
 else
-       ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
-       ip link set ${DEVICE} down
+       if [ -n "${SUBDEVICE}" ]; then
+               ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
+       else
+               ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
+               ip link set ${DEVICE} down
+       fi
 fi
 
 if [ "$HANDLING" = "4" ]; then
index 5231222a235db46ff59e90468d761f105286c9f0..cc2afe4515dff774bf52643844a7de93e1bf2b2e 100755 (executable)
@@ -169,10 +169,14 @@ else
                        IP4ADDROPT="brd + ${IP4ADDROPT}"
                fi
 
+               if [ -n "${SUBDEVICE}" ]; then
+                       ALIAS="label ${SUBDEVICE}"
+               fi
+
                if [ -n "$REMIP" ]; then
-                       ip addr add ${IP4ADDR} peer ${REMIP} dev ${DEVICE} ${IP4ADDROPT}
+                       ip addr add ${IP4ADDR} peer ${REMIP} ${ALIAS} dev ${DEVICE} ${IP4ADDROPT}
                else
-                       ip addr add ${IP4ADDR} dev ${DEVICE} ${IP4ADDROPT}
+                       ip addr add ${IP4ADDR} ${ALIAS} dev ${DEVICE} ${IP4ADDROPT}
                fi
        fi
 
This page took 0.243159 seconds and 4 git commands to generate.