From 599631bda00f650cdfc6e3f39d112efc0bb7c6bf Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Sun, 14 May 2006 01:34:30 +0000 Subject: Modify IPV6TO4_ROUTING to also add addresses on the interfaces Add RFC 3041 (IPv6 privacy) support (patch for both by Peter Bieringer ) --- sysconfig/network-scripts/network-functions-ipv6 | 35 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'sysconfig/network-scripts/network-functions-ipv6') 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: +# 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: # $2: -- cgit v1.2.1