]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix IPv6 routes on tap interfaces on OpenSolaris/OpenIndiana
authorGert Doering <gert@greenie.muc.de>
Wed, 9 Oct 2019 09:52:00 +0000 (11:52 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 9 Oct 2019 11:43:44 +0000 (13:43 +0200)
The "route add" code always used "metric 0" on OpenSolaris, because
(on tun interfaces) it was required to make the route work on
"non-ethernet" interfaces (connected, no NDP).

This breaks routes via tap interfaces on recent Solaris versions
(tested on OpenIndiana 2019) - there, routes only work if metric
is != 0 (or just not set).  Otherwise it tries to map the gateway
address to a local address and fails.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20191009095200.9337-2-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18906.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c

index 3183fb47f0d8ddaae744850ce575afa3f9f3e168..97e90e56b11140e6302cb6cb88ebdce018edfe55 100644 (file)
@@ -2043,8 +2043,8 @@ add_route_ipv6(struct route_ipv6 *r6, const struct tuntap *tt,
                 r6->netbits,
                 gateway );
 
-    /* on tun/tap, not "elsewhere"? -> metric 0 */
-    if (!r6->iface)
+    /* on tun (not tap), not "elsewhere"? -> metric 0 */
+    if (tt->type == DEV_TYPE_TUN && !r6->iface)
     {
         argv_printf_cat(&argv, "0");
     }