]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix installation of IPv6 host route to VPN server when using iservice.
authorGert Doering <gert@greenie.muc.de>
Sun, 19 Mar 2017 19:10:49 +0000 (20:10 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 20 Mar 2017 17:45:38 +0000 (18:45 +0100)
The "prepare IPv6 route message to interactive service" was properly
handing the correct interface index (r->adapter_index) for this case,
but then always overwrote the gateway address with our magic tun/tap
fe80::8 value.  Only do this for "on tap adapter" routes.

Pinpointed by Selva Nair.

Trac #850

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20170319191049.23970-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14282.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c

index 7e536effeb9a2ccd8627658e3fe221ad13b614dd..08998d5f4dfa021abcf5b8ba889ab2cfa08503fe 100644 (file)
@@ -3061,8 +3061,10 @@ do_route_ipv6_service(const bool add, const struct route_ipv6 *r, const struct t
 
     /* In TUN mode we use a special link-local address as the next hop.
      * The tapdrvr knows about it and will answer neighbor discovery packets.
+     * (only do this for routes actually using the tun/tap device)
      */
-    if (tt->type == DEV_TYPE_TUN)
+    if (tt->type == DEV_TYPE_TUN
+        && msg.iface.index == tt->adapter_index )
     {
         inet_pton(AF_INET6, "fe80::8", &msg.gateway.ipv6);
     }