chiark / gitweb /
svc/tripe-ifup.in: Trim prefix length from IPv6 address used as gateway.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 22 Dec 2014 20:32:58 +0000 (20:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 14 Mar 2015 14:25:55 +0000 (14:25 +0000)
Because IPv6 doesn't deal with point-to-point connections well, it's
common to use little networks.  But then the user needs to associate a
prefix length with the address, and we have to strip it off when adding
routes which use the address as a gateway.

svc/tripe-ifup.in

index 79f5d46984c903a036f9c5c089c5bf0163522419..ae447db8561b542ac4207a5d6a35f0cbc5ec78f1 100644 (file)
@@ -152,7 +152,7 @@ set -- $route6
 case $haveaddr6,$# in
   t,[1-9]*)
     for p in "$@"; do
-      ip route add $p proto static via "$r6addr"
+      ip route add $p proto static via "${r6addr%/*}"
     done
     ;;
 esac