revert mail route ipv6 test
authorIan Kelling <ian@iankelling.org>
Tue, 8 Sep 2020 20:08:13 +0000 (16:08 -0400)
committerIan Kelling <ian@iankelling.org>
Tue, 8 Sep 2020 20:08:13 +0000 (16:08 -0400)
mail-route

index 60d95d686503342cbe122aaf4d734faa2da84160..2aecfaad6d0f044b68cbcc83a3b7e104841bcf57 100755 (executable)
@@ -156,32 +156,12 @@ modify() {
     exists=true; ip -6 route show $iproutecmd | grep . &>/dev/null || exists=false
     if runtest; then e ip -6 route $ip_op $iproutecmd; fi
 
-
-    # Previously, I tried setting a default route with metric 6000, so
-    # that generally an isp assigned route would have lower metric and
-    # take precedence. The problem is that with linux SLAAC, it then
-    # stops assigning any default routes after the existing one
-    # expires. I can't find any way to get SLAAC to reassign the route
-    # other than rebooting. things i tried: googling. checking ipv6
-    # sysctl settings, they are all unchanged. The next thing I would
-    # need to do seems to be looking at the kernel source code. I dun
-    # wanna delve into that.
-
-    haveipv6=false
-    if [[ $(ip -6 r show default) ]]; then
-      haveipv6=true
-    fi
-
-    runtestipv6() {
-      runtest && { $stop || ! $haveipv6; }
-    }
-
-    iproutecmd="::/1 dev $tun_dev"
-    exists=true; ip -6 route show $iproutecmd | grep . &>/dev/null || exists=false
-    if runtestipv6; then e ip -6 route $ip_op $iproutecmd; fi
-    iproutecmd="8000::/1 dev $tun_dev"
+    # We could only do this if we dont have a default route with [[ ! $(ip -6 r show default) ]] but
+    # metric seems to be perfectly good. 6000 because on my home comp,
+    # its about 6 times slower to ping google, than the default 1024 metric.
+    iproutecmd="default dev $tun_dev"
     exists=true; ip -6 route show $iproutecmd | grep . &>/dev/null || exists=false
-    if runtestipv6; then e ip -6 route $ip_op $iproutecmd; fi
+    if runtest; then e ip -6 route $ip_op $iproutecmd metric 6000; fi
   fi
   # on debian this is 0 (no filter), on ubuntu it\'s 1, which is no good. 0 or 2 both work fine.
   # 2 drops it if the packet is not routable, martian address, or my default route is screwed up,