aboutsummaryrefslogtreecommitdiffstats
path: root/ppp
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-11-03 22:26:54 +0000
committerColin Guthrie <colin@mageia.org>2011-11-03 22:26:54 +0000
commit1e6179bf54cbc84b4ad33480e7f2f713418bb28a (patch)
tree794b2654be506d551421bcc47d3ad97822e2861c /ppp
parent87589b49d1543595188dcb26aa5a09d33e5e0a4e (diff)
parent6ce3e4700baa4e37e6b16e4160c00b2ebea58d81 (diff)
downloadinitscripts-1e6179bf54cbc84b4ad33480e7f2f713418bb28a.tar
initscripts-1e6179bf54cbc84b4ad33480e7f2f713418bb28a.tar.gz
initscripts-1e6179bf54cbc84b4ad33480e7f2f713418bb28a.tar.bz2
initscripts-1e6179bf54cbc84b4ad33480e7f2f713418bb28a.tar.xz
initscripts-1e6179bf54cbc84b4ad33480e7f2f713418bb28a.zip
Merge commit 'initscripts-9.34-1' into mga-34
This brings our fully patched initscripts branch up to version 9.34. Some code was not easily merged and thus not all functionality relating to multiple IP addresses per interface were merged in. Conflicts: Makefile lang.csh lang.sh prefdm rc.d/init.d/functions rc.d/init.d/netfs rc.d/init.d/network rc.d/rc rc.d/rc.local rc.d/rc.sysinit service sysconfig.txt sysconfig/network-scripts/ifdown-eth sysconfig/network-scripts/ifup-eth sysconfig/network-scripts/ifup-ipv6 sysconfig/network-scripts/ifup-sit sysconfig/network-scripts/ifup-tunnel sysconfig/network-scripts/network-functions systemd/system/fedora-sysinit-unhack.service
Diffstat (limited to 'ppp')
-rwxr-xr-xppp/ip-down.ipv6to44
-rwxr-xr-xppp/ip-up.ipv6to422
-rw-r--r--ppp/ipv6-up2
3 files changed, 14 insertions, 14 deletions
diff --git a/ppp/ip-down.ipv6to4 b/ppp/ip-down.ipv6to4
index d6e50b54..29f1c646 100755
--- a/ppp/ip-down.ipv6to4
+++ b/ppp/ip-down.ipv6to4
@@ -48,7 +48,7 @@ CONFIG=$1
source_config
# IPv6 don't need aliases anymore, config is skipped
-REALDEVICE=$(echo ${DEVICE} | sed 's/:.*//g')
+REALDEVICE=${DEVICE%%:*}
[ "$DEVICE" != "$REALDEVICE" ] && exit 0
if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then
@@ -104,7 +104,7 @@ if [ "$valid6to4config" = "yes" ]; then
if [ -n "$IPV6TO4_ROUTING" ]; then
# Delete routes to local networks
for devsuf in $IPV6TO4_ROUTING; do
- dev="$(echo $devsuf | awk -F- '{ print $1 }')"
+ dev="${devsuf%%-*}"
ipv6_cleanup_6to4_device $dev
done
fi
diff --git a/ppp/ip-up.ipv6to4 b/ppp/ip-up.ipv6to4
index b2f6e6e6..c41ad828 100755
--- a/ppp/ip-up.ipv6to4
+++ b/ppp/ip-up.ipv6to4
@@ -54,7 +54,7 @@ CONFIG=$1
source_config
# IPv6 don't need aliases anymore, config is skipped
-REALDEVICE=$(echo ${DEVICE} | sed 's/:.*//g')
+REALDEVICE=${DEVICE%%:*}
[ "$DEVICE" != "$REALDEVICE" ] && exit 0
if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then
@@ -84,11 +84,11 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
if [ -n "$ipv4addr" ]; then
# Test for non-global IPv4 address
if ! ipv6_test_ipv4_addr_global_usable $ipv4addr; then
- echo $"Given IPv4 address '$ipv4addr' is not globally usable"
+ net_log $"Given IPv4 address '$ipv4addr' is not globally usable" info
valid6to4config="no"
fi
else
- echo $"IPv6to4 configuration needs an IPv4 address on related interface or otherwise specified"
+ net_log $"IPv6to4 configuration needs an IPv4 address on related interface or otherwise specified" info
valid6to4config="no"
fi
if [ -z "$IPV6TO4_RELAY" ]; then
@@ -104,7 +104,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
if [ "$valid6to4config" = "yes" ]; then
# Delete routes to local networks
for devsuf in $IPV6TO4_ROUTING; do
- dev="$(echo $devsuf | awk -F- '{ print $1 }')"
+ dev="${devsuf%%-*}"
ipv6_cleanup_6to4_device $dev
done
@@ -112,7 +112,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
ipv6_cleanup_6to4_tunnels tun6to4
# Get MTU of master device
- ipv4mtu="$(/sbin/ip link show dev $DEVICE | grep -w "mtu" | awk '{ print $5 }')"
+ ipv4mtu="$(/sbin/ip link show dev $DEVICE | awk '/\<mtu\>/ { print $5 }')"
if [ -n "$ipv4mtu" ]; then
# IPv6 tunnel MTU is IPv4 MTU minus 20 for IPv4 header
tunnelmtu=$[ $ipv4mtu - 20 ]
@@ -120,7 +120,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
if [ -n "$IPV6TO4_MTU" ]; then
if [ $IPV6TO4_MTU -gt $tunnelmtu ]; then
- echo $"Warning: configured MTU '$IPV6TO4_MTU' for 6to4 exceeds maximum limit of '$tunnelmtu', ignored"
+ net_log $"Warning: configured MTU '$IPV6TO4_MTU' for 6to4 exceeds maximum limit of '$tunnelmtu', ignored" warning
else
tunnelmtu=$IPV6TO4_MTU
fi
@@ -135,7 +135,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
# Add default route, if device matches
if [ "$IPV6_DEFAULTDEV" = "tun6to4" ]; then
if [ -n "$IPV6_DEFAULTGW" ]; then
- echo $"Warning: interface 'tun6to4' does not support 'IPV6_DEFAULTGW', ignored"
+ net_log $"Warning: interface 'tun6to4' does not support 'IPV6_DEFAULTGW', ignored" warning
fi
ipv6_set_default_route $ipv6to4_relay tun6to4
fi
@@ -155,7 +155,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
# Setup additional static IPv6 routes (newer config style)
if [ -f "/etc/sysconfig/network-scripts/route6-tun6to4" ]; then
- cat "/etc/sysconfig/network-scripts/route6-tun6to4" | sed 's/#.*//g' | grep -v '^[[:space:]]*$' | while read line; do
+ sed -ne 's/#.*//' -e '/[^[:space:]]/p' /etc/sysconfig/network-scripts/route6-tun6to4 | while read line; do
if echo "$line" | grep -vq 'via'; then
# Add gateway if missing
line="$line via $ipv6to4_relay"
@@ -178,15 +178,15 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
if [ -n "$ipv6to4prefix" ]; then
# Add IPv6 address to interface (required interface route will be set automatically)
for devsuf in $IPV6TO4_ROUTING; do
- dev="$(echo $devsuf | awk -F- '{ print $1 }')"
+ dev="${devsuf%%-*}"
suf="$(echo $devsuf | awk -F- '{ print $2 }')"
ipv6_add_addr_on_device ${dev} ${ipv6to4prefix}${suf}
done
else
- echo $"Error occured while calculating the IPv6to4 prefix"
+ net_log $"Error occured while calculating the IPv6to4 prefix"
fi
else
- echo $"radvd control enabled, but config is not complete"
+ net_log $"radvd control enabled, but config is not complete"
fi
fi
fi
diff --git a/ppp/ipv6-up b/ppp/ipv6-up
index 06062cfa..54219e43 100644
--- a/ppp/ipv6-up
+++ b/ppp/ipv6-up
@@ -97,7 +97,7 @@ fi
# Setup additional static IPv6 routes (newer config style)
if [ -f "/etc/sysconfig/network-scripts/route6-$DEVICE" ]; then
- cat "/etc/sysconfig/network-scripts/route6-$DEVICE" | sed 's/#.*//g' | grep -v '^[[:space:]]*$' | while read line; do
+ sed -ne 's/#.*//' -e '/[^[:space:]]/p' "/etc/sysconfig/network-scripts/route6-$DEVICE" | while read line; do
/sbin/ip -6 route add $line
done
fi