aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-17 19:56:43 +0100
committerColin Guthrie <colin@mageia.org>2013-10-18 09:35:39 +0100
commit9cec39ee7ef6a745c3a9b19d1ba6e89b09da43c3 (patch)
tree3a122662900195e7b14067a03cd5124358db9daf /sysconfig
parent423b437e3d29673dfad4051515506e6d711d20e6 (diff)
parent8f5a82934f801ec94847fc899d235a39df9967a7 (diff)
downloadinitscripts-user/colin/update-to-9-50.tar
initscripts-user/colin/update-to-9-50.tar.gz
initscripts-user/colin/update-to-9-50.tar.bz2
initscripts-user/colin/update-to-9-50.tar.xz
initscripts-user/colin/update-to-9-50.zip
Merge tag 'initscripts-9.50-1' into distro/mgauser/colin/update-to-9-50
Tag as initscripts-9.50-1 Conflicts: Makefile lang.csh lang.sh po/Makefile rc.d/init.d/network service sysconfig.txt sysconfig/init sysconfig/network-scripts/ifup sysconfig/network-scripts/ifup-eth sysconfig/network-scripts/ifup-ippp sysconfig/network-scripts/network-functions sysctl.conf systemd/fedora-storage-init
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/init11
-rw-r--r--sysconfig/init.s3905
-rwxr-xr-xsysconfig/network-scripts/ifdown11
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth12
-rwxr-xr-xsysconfig/network-scripts/ifdown-post2
-rwxr-xr-xsysconfig/network-scripts/ifdown-tunnel4
-rwxr-xr-xsysconfig/network-scripts/ifup11
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases11
-rwxr-xr-xsysconfig/network-scripts/ifup-eth88
-rw-r--r--sysconfig/network-scripts/ifup-ipv65
-rwxr-xr-xsysconfig/network-scripts/ifup-post4
-rw-r--r--sysconfig/network-scripts/ifup-sit6
-rwxr-xr-xsysconfig/network-scripts/ifup-tunnel13
-rwxr-xr-xsysconfig/network-scripts/ifup-wireless2
-rw-r--r--sysconfig/network-scripts/network-functions51
15 files changed, 140 insertions, 96 deletions
diff --git a/sysconfig/init b/sysconfig/init
index cf2eb896..fc874e10 100644
--- a/sysconfig/init
+++ b/sysconfig/init
@@ -15,14 +15,3 @@ SETCOLOR_FAILURE="echo -en \\033[1;31m"
SETCOLOR_WARNING="echo -en \\033[1;33m"
# terminal sequence to reset to the default color.
SETCOLOR_NORMAL="echo -en \\033[0;39m"
-# default kernel loglevel on boot (syslog will reset this)
-LOGLEVEL=3
-# Set to anything other than 'no' to allow hotkey interactive startup...
-PROMPT=yes
-# Set to 'yes' to allow probing for devices with swap signatures
-AUTOSWAP=no
-# What ttys should gettys be started on?
-ACTIVE_CONSOLES=/dev/tty[1-6]
-# Set to '/sbin/sulogin' to prompt for password on single-user mode
-# Set to '/sbin/sushell' otherwise
-SINGLE=/sbin/sushell
diff --git a/sysconfig/init.s390 b/sysconfig/init.s390
index 802732da..d28446c9 100644
--- a/sysconfig/init.s390
+++ b/sysconfig/init.s390
@@ -19,8 +19,3 @@ SETCOLOR_NORMAL=
LOGLEVEL=3
# Set to anything other than 'no' to allow hotkey interactive startup...
PROMPT=no
-# What ttys should gettys be started on?
-ACTIVE_CONSOLES=/dev/console
-# Set to '/sbin/sulogin' to prompt for password on single-user mode
-# Set to '/sbin/sushell' otherwise
-SINGLE=/sbin/sushell
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 34a10c53..b9a7a1fc 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -12,14 +12,14 @@ cd /etc/sysconfig/network-scripts
CONFIG=$1
[ -z "$CONFIG" ] && {
- echo $"usage: ifdown <device name>" >&2
+ echo $"usage: ifdown <configuration>" >&2
exit 1
}
need_config "${CONFIG}"
[ -f "$CONFIG" ] || {
- echo $"usage: ifdown <device name>" >&2
+ echo $"usage: ifdown <configuration>" >&2
exit 1
}
@@ -46,8 +46,11 @@ if [ "$_use_nm" = "true" ]; then
DEVICE=$(nmcli -t --fields uuid,devices con status | awk -F ':' "\$1 == \"$UUID\" { print \$2 }")
fi
if [ -n "$DEVICE" ] && ! is_nm_device_unmanaged "$DEVICE" ; then
- nmcli dev disconnect iface "$DEVICE"
- exit $?
+ if ! LC_ALL=C nmcli -t -f STATE,DEVICE dev status | egrep -q "^(failed|disconnected|unmanaged|unavailable):$DEVICE$"; then
+ nmcli dev disconnect iface "$DEVICE"
+ exit $?
+ fi
+ exit 0
fi
echo $"$0: interface ${CONFIG} is controlled by NetworkManager; skipping." >&2
exit 0
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 56ea2725..cd91e766 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
. /etc/init.d/functions
@@ -56,7 +56,7 @@ fi
fi
if is_bonding_device ${DEVICE} ; then
- for device in $(LANG=C egrep -l "^[[:space:]]*MASTER=\"?${DEVICE}\"?[[:space:]]*$" /etc/sysconfig/network-scripts/ifcfg-*) ; do
+ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
is_ignored_file "$device" && continue
/sbin/ifdown ${device##*/}
done
@@ -139,9 +139,9 @@ fi
# instance instead.
if [ -d "/sys/class/net/${REALDEVICE}" ]; then
if [ "${REALDEVICE}" = "${DEVICE}" ]; then
- ip addr flush dev ${REALDEVICE} 2>/dev/null
+ ip addr flush dev ${REALDEVICE} scope global 2>/dev/null
else
- ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
+ ip addr flush dev ${REALDEVICE} label ${DEVICE} scope global 2>/dev/null
fi
if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then
@@ -171,7 +171,9 @@ if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then
fi
if [ "${TYPE}" = "Tap" ]; then
- tunctl -d "${DEVICE}" >/dev/null
+ TUNMODE="mode tap"
+ [[ ${DEVICE} == tun* ]] && TUNMODE="mode tun"
+ ip tuntap del ${TUNMODE} dev ${DEVICE} >/dev/null
fi
# wait up to 5 seconds for device to actually come down...
diff --git a/sysconfig/network-scripts/ifdown-post b/sysconfig/network-scripts/ifdown-post
index 78fbd8a6..ce356f1e 100755
--- a/sysconfig/network-scripts/ifdown-post
+++ b/sysconfig/network-scripts/ifdown-post
@@ -45,7 +45,7 @@ fi
# Inform firewall
if [ -x /usr/bin/firewall-cmd -a "${REALDEVICE}" != "lo" ]; then
- /usr/bin/firewall-cmd --remove --interface="${DEVICE}" > /dev/null 2>&1
+ /usr/bin/firewall-cmd --remove-interface="${DEVICE}" > /dev/null 2>&1
fi
# Notify programs that have requested notification
diff --git a/sysconfig/network-scripts/ifdown-tunnel b/sysconfig/network-scripts/ifdown-tunnel
index e04effe7..d2ac6922 100755
--- a/sysconfig/network-scripts/ifdown-tunnel
+++ b/sysconfig/network-scripts/ifdown-tunnel
@@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Thanks to:
# - Razvan Corneliu C.R. Vilt <razvan.vilt@linux360.ro>
@@ -32,7 +32,7 @@ need_config "$CONFIG"
source_config
# Generic tunnel devices are not supported here
-if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 ]; then
+if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 -o "$DEVICE" = ip6tnl0 ]; then
net_log $"Device '$DEVICE' isn't supported as a valid GRE device name."
exit 1
fi
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 18dad676..a5feff88 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
PATH=/sbin:/usr/sbin:/bin:/usr/bin
TEXTDOMAIN=initscripts
@@ -30,7 +30,7 @@ cd /etc/sysconfig/network-scripts
CONFIG=${1}
[ -z "${CONFIG}" ] && {
- echo $"Usage: ifup <device name>" >&2
+ echo $"Usage: ifup <configuration>" >&2
exit 1
}
@@ -38,7 +38,7 @@ need_config "${CONFIG}"
[ -f "${CONFIG}" ] || {
echo $"$0: configuration for ${1} not found." >&2
- echo $"Usage: ifup <device name>" >&2
+ echo $"Usage: ifup <configuration>" >&2
exit 1
}
@@ -70,6 +70,9 @@ fi
if [ "$_use_nm" = "true" ]; then
if [ -n "$UUID" ]; then
+ if [ "foo$2" = "fooboot" ] && [ "${TYPE}" = "Wireless" ]; then
+ exit 0
+ fi
nmcli con up uuid "$UUID"
exit $?
fi
@@ -133,6 +136,8 @@ if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ]; then
}
fi
fi
+
+ /usr/lib/systemd/systemd-sysctl --prefix "/proc/sys/net/ipv4/conf/${DEVICE}" --prefix "/proc/sys/net/ipv6/conf/${DEVICE}"
fi
# signalling the start of connection
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index a647044f..9bc815f3 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -139,6 +139,7 @@ function ini_env ()
GATEWAY=$default_GATEWAY
NO_ALIASROUTING=$default_NO_ALIASROUTING
ONPARENT=""
+ ARPCHECK=""
}
function is_default_gateway ()
@@ -256,9 +257,17 @@ function new_interface ()
fi
if [ "$setup_this" = "yes" ] ; then
+ [ "${parent_device}" != "lo" ] && [ "${ARPCHECK}" != "no" ] && \
+ is_available ${parent_device} && \
+ grep -qswi "up" /sys/class/net/${parent_device}/operstate && \
+ if ! /sbin/arping -q -c 2 -w 3 -D -I ${parent_device} ${IPADDR} ; then
+ net_log $"Error, some other host already uses address ${IPADDR}."
+ return 1
+ fi
+
/sbin/ip addr add ${IPADDR}/${PREFIX} brd ${BROADCAST} dev ${parent_device} label ${DEVICE}
- [ "$IPV6INIT" = "yes" ] && /etc/sysconfig/network-scripts/ifup-ipv6 ${DEVICE}
+ [[ "$IPV6INIT" != [nN0]* ]] && /etc/sysconfig/network-scripts/ifup-ipv6 ${DEVICE}
if [ "$NO_ALIASROUTING" != yes ]; then
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index e51fdf53..9d62adfb 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
PATH=/sbin:/usr/sbin:/bin:/usr/bin
TEXTDOMAIN=initscripts
@@ -78,13 +78,8 @@ if [ "${TYPE}" = "Bridge" ]; then
done
fi
-# If the device is a tap device, create it with tunctl, if available.
+# Create tap device.
if [ "${TYPE}" = "Tap" ]; then
- if [ ! -x /usr/sbin/tunctl -a ! -x /usr/bin/tunctl ]; then
- net_log $"Tap support not available: tunctl not found"
- mdv-network-event connection_failure ${DEVICE}
- exit 1
- fi
# load the correct module if necessary (#54748)
if [ ! -c /dev/net/tun ]; then
if ! modprobe tun > /dev/null 2>&1; then
@@ -94,8 +89,10 @@ if [ "${TYPE}" = "Tap" ]; then
fi
fi
- [ -n "${OWNER}" ] && OWNER="-u ${OWNER}"
- tunctl ${OWNER} -t ${DEVICE} > /dev/null
+ [ -n "${OWNER}" ] && OWNER="user ${OWNER}"
+ TUNMODE="mode tap"
+ [[ ${DEVICE} == tun* ]] && TUNMODE="mode tun"
+ ip tuntap add ${TUNMODE} ${OWNER} dev ${DEVICE} > /dev/null
fi
# now check the real state
@@ -192,38 +189,15 @@ fi
# Bonding initialization. For DHCP, we need to enslave the devices early,
# so it can actually get an IP.
if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then
-
- /sbin/ip link set dev ${DEVICE} down
-
- # add the bits to setup driver parameters here
- for arg in $BONDING_OPTS ; do
- key=${arg%%=*};
- value=${arg##*=};
- if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then
- OLDIFS=$IFS;
- IFS=',';
- for arp_ip in $value; do
- if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then
- echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key
- fi
- done
- IFS=$OLDIFS;
- elif [ "${key}" = "arp_ip_target" ]; then
- if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then
- echo "$value" > /sys/class/net/${DEVICE}/bonding/$key
- fi
- elif [ "${key}" != "primary" ]; then
- echo $value > /sys/class/net/${DEVICE}/bonding/$key
- fi
- done
-
+ install_bonding_driver ${DEVICE}
/sbin/ip link set dev ${DEVICE} up
- [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
- for device in $(LANG=C egrep -l "^[[:space:]]*MASTER=\"?${DEVICE}\"?[[:space:]]*$" /etc/sysconfig/network-scripts/ifcfg-*) ; do
+ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do
is_ignored_file "$device" && continue
/sbin/ifup ${device##*/}
done
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
+
# add the bits to setup the needed post enslavement parameters
for arg in $BONDING_OPTS ; do
key=${arg%%=*};
@@ -382,6 +356,7 @@ if [ -n "${DYNCONFIG}" ]; then
if $DHCP_CLIENT $DHCP_ARGS ; then
mdv-network-event dhcp_success ${DEVICE}
echo $" done."
+ dhcpipv4="good"
else
mdv-network-event dhcp_failure ${DEVICE}
# Associate a zeroconf IP address to an alias of the interface
@@ -398,8 +373,15 @@ if [ -n "${DYNCONFIG}" ]; then
fi
mdv-network-event zcip_failure ${DEVICE}
echo $" failed."
- mdv-network-event connection_failure ${DEVICE}
- exit 1
+ if [[ "${IPV4_FAILURE_FATAL}" = [Yy1]* ]] ; then
+ mdv-network-event connection_failure ${DEVICE}
+ exit 1
+ fi
+ if [[ "$IPV6INIT" = [nN0]* || "$DHCPV6C" != [yY1]* ]] ; then
+ mdv-network-event connection_failure ${DEVICE}
+ exit 1
+ fi
+ net_log "Unable to obtain IPv4 DHCP address ${DEVICE}." warning
fi
# end dynamic device configuration
else
@@ -445,11 +427,13 @@ else
fi
if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then
- [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \
- if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then
- net_log $"Error, some other host already uses address ${ipaddr[$idx]}."
- mdv-network-event connection_failure ${DEVICE}
- exit 1
+ if [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] ; then
+ /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]}
+ if [ $? = 1 ]; then
+ net_log $"Error, some other host already uses address ${ipaddr[$idx]}."
+ mdv-network-event connection_failure ${DEVICE}
+ exit 1
+ fi
fi
if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \
@@ -499,12 +483,28 @@ if [ "${NOZEROCONF}" != "yes" -a "${ISALIAS}" = "no" -a "${REALDEVICE}" != "lo"
ip route add 169.254.0.0/16 dev ${REALDEVICE} metric $((1000 + $(cat /sys/class/net/${REALDEVICE}/ifindex))) scope link
fi
+# Inform firewall which network zone (empty means default) this interface belongs to
+if [ -x /usr/bin/firewall-cmd -a "${REALDEVICE}" != "lo" ]; then
+ /usr/bin/firewall-cmd --zone="${ZONE}" --change-interface="${DEVICE}" > /dev/null 2>&1
+fi
+
# IPv6 initialisation?
/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
generate_config_file_name 6
generate_lease_file_name 6
- /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}
+ echo
+ echo -n $"Determining IPv6 information for ${DEVICE}..."
+ if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then
+ echo $" done."
+ else
+ echo $" failed."
+ if [ "${dhcpipv4}" = "good" -o -n "${IPADDR}" ]; then
+ net_log "Unable to obtain IPv6 DHCP address ${DEVICE}." warning
+ else
+ exit 1
+ fi
+ fi
fi
if [ "${IPX}" = yes ]; then
diff --git a/sysconfig/network-scripts/ifup-ipv6 b/sysconfig/network-scripts/ifup-ipv6
index 509e49f3..4d84afee 100644
--- a/sysconfig/network-scripts/ifup-ipv6
+++ b/sysconfig/network-scripts/ifup-ipv6
@@ -65,8 +65,8 @@ source_config
REALDEVICE=${DEVICE%%:*}
DEVICE=$REALDEVICE
-# Test whether IPv6 configuration is enabled for this interface, else stop
-[ "$IPV6INIT" = "yes" ] || exit 0
+# Test whether IPv6 configuration is disabled for this interface
+[[ "$IPV6INIT" = [nN0]* ]] && exit 0
[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1
. /etc/sysconfig/network-scripts/network-functions-ipv6
@@ -127,6 +127,7 @@ fi
/sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.forwarding=$ipv6_local_forwarding >/dev/null 2>&1
/sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.accept_ra=$ipv6_local_auto >/dev/null 2>&1
/sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.accept_redirects=$ipv6_local_auto >/dev/null 2>&1
+/sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.autoconf=$ipv6_local_auto >/dev/null 2>&1
# Set IPv6 MTU, if given
if [ -n "$IPV6_MTU" ]; then
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post
index 2937bd3d..61cfc446 100755
--- a/sysconfig/network-scripts/ifup-post
+++ b/sysconfig/network-scripts/ifup-post
@@ -1,4 +1,4 @@
-
+#!/bin/sh
cd /etc/sysconfig/network-scripts
. ./network-functions
@@ -99,7 +99,7 @@ fi
# Inform firewall which network zone (empty means default) this interface belongs to
if [ -x /usr/bin/firewall-cmd -a "${REALDEVICE}" != "lo" ]; then
- /usr/bin/firewall-cmd --zone="${ZONE}" --change --interface="${DEVICE}" > /dev/null 2>&1
+ /usr/bin/firewall-cmd --zone="${ZONE}" --change-interface="${DEVICE}" > /dev/null 2>&1
fi
# Notify programs that have requested notification
diff --git a/sysconfig/network-scripts/ifup-sit b/sysconfig/network-scripts/ifup-sit
index 1d395e99..e83ef058 100644
--- a/sysconfig/network-scripts/ifup-sit
+++ b/sysconfig/network-scripts/ifup-sit
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# ifup-sit
#
@@ -43,8 +43,8 @@ source_config
REALDEVICE=${DEVICE%%:*}
[ "$DEVICE" != "$REALDEVICE" ] && exit 0
-# Test whether IPv6 configuration is enabled for this interface, else stop
-[ "$IPV6INIT" = "yes" ] || exit 0
+# Test whether IPv6 configuration is disabled for this interface
+[[ "$IPV6INIT" = [nN0]* ]] && exit 0
[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1
. /etc/sysconfig/network-scripts/network-functions-ipv6
diff --git a/sysconfig/network-scripts/ifup-tunnel b/sysconfig/network-scripts/ifup-tunnel
index b235bfe0..a4762127 100755
--- a/sysconfig/network-scripts/ifup-tunnel
+++ b/sysconfig/network-scripts/ifup-tunnel
@@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Thanks to:
# - Razvan Corneliu C.R. Vilt <razvan.vilt@linux360.ro>
@@ -39,12 +39,19 @@ fi
case "$TYPE" in
GRE)
MODE=gre
+ proto=-4
/sbin/modprobe ip_gre
;;
IPIP)
MODE=ipip
+ proto=-4
/sbin/modprobe ipip
;;
+ IPIP6)
+ MODE=ipip6
+ proto=-6
+ /sbin/modprobe ip6_tunnel
+ ;;
*)
net_log $"Invalid tunnel type $TYPE"
exit 1
@@ -52,7 +59,7 @@ case "$TYPE" in
esac
# Generic tunnel devices are not supported here
-if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 ]; then
+if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 -o "$DEVICE" = ip6tnl0 ]; then
net_log $"Device '$DEVICE' isn't supported as a valid GRE device name."
mdv-network-event connection_failure ${DEVICE}
exit 1
@@ -60,7 +67,7 @@ fi
# Create the tunnel
# The outer addresses are those of the underlying (public) network.
-/sbin/ip tunnel add "$DEVICE" mode "$MODE" \
+/sbin/ip $proto tunnel add "$DEVICE" mode "$MODE" \
${MY_OUTER_IPADDR:+local "$MY_OUTER_IPADDR"} \
${PEER_OUTER_IPADDR:+remote "$PEER_OUTER_IPADDR"} \
${KEY:+key "$KEY"} ${TTL:+ttl "$TTL"}
diff --git a/sysconfig/network-scripts/ifup-wireless b/sysconfig/network-scripts/ifup-wireless
index 828af727..f983e2dc 100755
--- a/sysconfig/network-scripts/ifup-wireless
+++ b/sysconfig/network-scripts/ifup-wireless
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Configure wireless network device options. See iwconfig(8) for more info.
# Mageia prefixes the following variables with WIRELESS_ prefix.
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index fd6572ba..2ffdee55 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -24,7 +24,7 @@ get_hwaddr ()
get_config_by_device ()
{
- LANG=C grep -l "^[[:space:]]*DEVICE=${1}\([[:space:]#]\|$\)" \
+ LANG=C grep -l "^[[:space:]]*DEVICE=\"\?${1}\"\?\([[:space:]#]\|$\)" \
/etc/sysconfig/network-scripts/ifcfg-* \
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
@@ -143,10 +143,7 @@ source_config ()
CTC)
DEVICETYPE="ctc"
;;
- IUCV)
- DEVICETYPE="iucv"
- ;;
- GRE | IPIP)
+ GRE | IPIP | IPIP6)
DEVICETYPE="tunnel"
;;
SIT | sit)
@@ -155,6 +152,9 @@ source_config ()
InfiniBand | infiniband)
DEVICETYPE="ib"
;;
+ OVS*)
+ DEVICETYPE="ovs"
+ ;;
esac
if [ -n "$HWADDR" ]; then
HWADDR=$(echo $HWADDR | awk '{ print toupper($0) }')
@@ -437,14 +437,47 @@ add_default_route ()
is_wireless_device ()
{
- [ -d "/sys/class/net/$1/wireless" -o -d "/sys/class/net/$1/phy80211" ]
+ [ -x /sbin/iwconfig ] || return 1
+ LC_ALL=C iwconfig $1 2>&1 | grep -q "no wireless extensions" || return 0
+ return 1
}
install_bonding_driver ()
{
- [ -d "/sys/class/net/$1" ] && return 0
[ ! -f /sys/class/net/bonding_masters ] && ( modprobe bonding || return 1 )
- echo "+$1" > /sys/class/net/bonding_masters 2>/dev/null
+ if ! grep -sq "$1" /sys/class/net/bonding_masters; then
+ echo "+$1" > /sys/class/net/bonding_masters 2>/dev/null
+ fi
+ (
+ # Set config here
+ need_config "$1"
+ source_config
+ if [ -f /sys/class/net/${DEVICE}/bonding/slaves -a $(wc -l < /sys/class/net/${DEVICE}/bonding/slaves) -eq 0 ]; then
+ /sbin/ip link set dev ${DEVICE} down
+
+ # add the bits to setup driver parameters here
+ for arg in $BONDING_OPTS ; do
+ key=${arg%%=*};
+ value=${arg##*=};
+ if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then
+ OLDIFS=$IFS;
+ IFS=',';
+ for arp_ip in $value; do
+ if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then
+ echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key
+ fi
+ done
+ IFS=$OLDIFS;
+ elif [ "${key}" = "arp_ip_target" ]; then
+ if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then
+ echo "$value" > /sys/class/net/${DEVICE}/bonding/$key
+ fi
+ elif [ "${key}" != "primary" ]; then
+ echo $value > /sys/class/net/${DEVICE}/bonding/$key
+ fi
+ done
+ fi
+ )
return 0
}
@@ -494,7 +527,7 @@ change_resolv_conf ()
if [ $r -eq 0 ]; then
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/resolv.conf >/dev/null 2>&1 # reset the correct context
/usr/bin/logger -p local7.notice -t "NET" -i "$0 : updated /etc/resolv.conf";
- [ -n "$(/bin/pidof nscd)" ] && [ ! -e "$RESOLVCONF_FLAGFILE" ] && /usr/sbin/nscd -i hosts; # invalidate cache
+ [ -e /var/run/nscd/socket ] && [ ! -e "$RESOLVCONF_FLAGFILE" ] && /usr/sbin/nscd -i hosts; # invalidate cache
fi;
return $r;
}