aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions-ipv6
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-05-14 01:34:30 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-05-14 01:34:30 +0000
commit599631bda00f650cdfc6e3f39d112efc0bb7c6bf (patch)
treef2139af6236f9fc2027276b8cf3994f0d9cb8aff /sysconfig/network-scripts/network-functions-ipv6
parent906238c891d3f02b4c706457783694e3a01d91ce (diff)
downloadinitscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar
initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar.gz
initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar.bz2
initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar.xz
initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.zip
Modify IPV6TO4_ROUTING to also add addresses on the interfaces
Add RFC 3041 (IPv6 privacy) support (patch for both by Peter Bieringer <pb@bieringer.de>)
Diffstat (limited to 'sysconfig/network-scripts/network-functions-ipv6')
-rw-r--r--sysconfig/network-scripts/network-functions-ipv635
1 files changed, 32 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/network-functions-ipv6 b/sysconfig/network-scripts/network-functions-ipv6
index 153c05ea..5ee91187 100644
--- a/sysconfig/network-scripts/network-functions-ipv6
+++ b/sysconfig/network-scripts/network-functions-ipv6
@@ -8,7 +8,7 @@
# You will find more information on the initscripts-ipv6 homepage at
# http://www.deepspace6.net/projects/initscripts-ipv6.html
#
-# Version: 2005-03-03
+# Version: 2005-09-22
#
#
@@ -419,12 +419,12 @@ ipv6_cleanup_routes() {
if [ -n "$gatewaymatch" ]; then
# Get all IPv6 routes (except default link-local and multicast) through given interface via a given gateway and remove them
ipv6_exec_ip -6 route show dev $device via $gatewaymatch | LC_ALL=C grep -v -w expires | LC_ALL=C egrep -v "^fe80::/64|^ff00::/8" | while read ipv6net dummy; do
- ipv6_exec_ip -6 route del $ipv6net via $gatewaymatch dev $iface
+ ipv6_del_route $ipv6net $gatewaymatch $device
done
else
# Get all IPv6 routes (except default link-local and multicast) through given interface and remove them
ipv6_exec_ip -6 route show dev $device | LC_ALL=C grep -v -w expires | LC_ALL=C egrep -v "^fe80::/64|^ff00::/8" | while read ipv6net dummy; do
- ipv6_exec_ip -6 route del $ipv6net dev $iface
+ ipv6_del_route $ipv6net :: $device
done
fi
@@ -594,6 +594,35 @@ ipv6_cleanup_device() {
}
+## Remove all IPv6 6to4 related routes and addresses on given interface
+# $1: <Interface>
+# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem
+ipv6_cleanup_6to4_device() {
+ local fn="ipv6_cleanup_6to4_device"
+
+ local device=$1
+
+ if [ -z "$device" ]; then
+ ipv6_log $"Missing parameter 'device' (arg 1)" err $fn
+ return 1
+ fi
+
+ ipv6_test testonly || return 2
+
+ # Cleanup 6to4 addresses on this device
+ ipv6_exec_ip -6 addr show dev $dev scope global permanent | LC_ALL=C grep -w inet6 | awk '{ print $2}' | LC_ALL=C grep "^2002:" | while read addr; do
+ ipv6_del_addr_on_device ${dev} ${addr}
+ done
+
+ # Get all IPv6 routes through given interface via a given gateway and remove them
+ ipv6_exec_ip -6 route show dev $device | LC_ALL=C grep "^2002:" | while read ipv6net dummy; do
+ ipv6_del_route $ipv6net :: $device
+ done
+
+ return 0
+}
+
+
## Remove an IPv6 address on given interface
# $1: <Interface>
# $2: <IPv6 address>