-  l := getv6localips;\r
-  if biniplist_getcount(l) = 0 then exit;\r
-  useaf := useaf_preferv4;\r
-  ipstrtobin('2000::',ipmask_global);\r
-  ipstrtobin('2001::',ipmask_teredo);\r
-  ipstrtobin('2002::',ipmask_6to4);\r
-  {if there is any v6 IP which is globally routable and not 6to4 and not teredo, prefer v6}\r
-  for a := biniplist_getcount(l)-1 downto 0 do begin\r
-    ip := biniplist_get(l,a);\r
-    if not comparebinipmask(ip,ipmask_global,3) then continue;\r
-    if comparebinipmask(ip,ipmask_teredo,32) then continue;\r
-    if comparebinipmask(ip,ipmask_6to4,16) then continue;\r
-    useaf := useaf_preferv6;\r
-    preferredmodeinited := true;\r
-    exit;\r
-  end;\r
+\r
+  if (have_ipv6_connectivity) then\r
+    useaf := useaf_preferv6\r
+  else\r
+    useaf := useaf_preferv4;\r
+\r
+  preferredmodeinited := true;\r