From 27740b376c1ca89a43dcff5c8309f1e1afecc5c9 Mon Sep 17 00:00:00 2001 From: Gert Doering Date: Sun, 19 Mar 2017 20:10:49 +0100 Subject: [PATCH] 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 Acked-by: Selva Nair 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 --- src/openvpn/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 7e536effe..08998d5f4 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -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); } -- 2.47.2