From: Gert Doering Date: Sun, 19 Mar 2017 19:10:49 +0000 (+0100) Subject: Fix installation of IPv6 host route to VPN server when using iservice. X-Git-Tag: v2.5_beta1~717 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=27740b376c1ca89a43dcff5c8309f1e1afecc5c9;p=thirdparty%2Fopenvpn.git 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 --- 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); }