--- openswan-2.4.9-orig/programs/_startklips/_startklips.in	2007-07-06 14:29:15.000000000 -0300
+++ openswan-2.4.9/programs/_startklips/_startklips.in	2007-08-24 21:50:25.000000000 -0300
@@ -224,8 +224,8 @@
 	next=`netstat -nr |
 		awk '$1 == "0.0.0.0" && $3 == "0.0.0.0" { print $2 }'`
 	if [ "$next" = "0.0.0.0" ] ; then
-		next=`ip addr list $phys | grep -E '^ +inet6*.*scope global $phys' |
+		next=`ip addr list $phys | grep -E "^ +inet6*.*scope global $phys" |
-			awk '{ print $2}' | awk -F / '{ print $1 }'`
+			awk '{ if($3=="peer")print $4; else print $2 }' | awk -F / '{ print $1 }'`
 	fi
 	klipsinterface "ipsec0=$phys" $next
 }

