Browse code

Fix installation of IPv6 host route to VPN server when using iservice.

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>

Gert Doering authored on 2017/03/20 04:10:49
Showing 1 changed files
... ...
@@ -3061,8 +3061,10 @@ do_route_ipv6_service(const bool add, const struct route_ipv6 *r, const struct t
3061 3061
 
3062 3062
     /* In TUN mode we use a special link-local address as the next hop.
3063 3063
      * The tapdrvr knows about it and will answer neighbor discovery packets.
3064
+     * (only do this for routes actually using the tun/tap device)
3064 3065
      */
3065
-    if (tt->type == DEV_TYPE_TUN)
3066
+    if (tt->type == DEV_TYPE_TUN
3067
+	 && msg.iface.index == tt->adapter_index )
3066 3068
     {
3067 3069
         inet_pton(AF_INET6, "fe80::8", &msg.gateway.ipv6);
3068 3070
     }