#!/bin/sh - keep it for file(1) to get bourne shell script result
#
-# $Id$
#
# This is not a shell script; it provides functions to network scripts
# that source it.
{
# 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 } ')
+ # If there's a dot, it's a vlan
+ if echo ${DEVICE} | LC_ALL=C grep -qE '^[a-z0-9]+\.[0-9]+$'; then
+ DEVICETYPE=vlan
+ else
+ DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[\.:]?[0-9]*[\.:]?[0-9]*$/,NUL); print $0 } ')
+ fi
fi
- # Setup DEVICETYPE for special cases.
- if echo ${DEVICE} | LC_ALL=C grep -qE '^[a-z0-9]+\.[0-9]+$'; then
- DEVICETYPE=vlan
- fi
# real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias)
SUBDEVICE=$(echo "$DEVICE" | grep -E "([0-9]+:[0-9]+)")
esac
# Multicast ready devices
- if is_yes "$MULTICAST"; then
- MULTICAST="on"
+ if [ -n "$MULTICAST" ]; then
+ MULTICAST="$MULTICAST"
else
case "$DEVICETYPE" in
- eth|br)
+ eth|br|vlan)
MULTICAST="on"
;;
*)
if [ -z "${IPV6_GLOBALROUTEDEV}" -o "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then
# set up default route
if [ "${IPV6_GLOBALROUTEGW}" ]; then
+ ip -6 route add ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
ip -6 route add 2000::/3 via ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
elif [ "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then
ip -6 route add 2000::/3 dev ${DEVICE} ${IP6SRCADDR}
ip addr add 127.0.0.1/8 dev lo
fi
ip link set dev lo up
- emit net-device-up IFACE=lo
grep -E "^(lo|any)[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
if [[ "$args" = *:* ]]; then
if ! LC_ALL=C ip link show dev $device 2>/dev/null | grep -Fq UP; then
ip link set dev $device up >/dev/null 2>&1
- emit net-device-up IFACE=$device
fi
timeout=0
while [ $timeout -le $max_timeout ]; do