Fix installation of IPv6 host route to VPN server when using iservice.
PATCH 1/1 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
--- src/openvpn/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/openvpn/route.c +3 -1
@@ -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); }
Signature · 1 line
2.10.2
Hi,
Quoted 25 lines · Gert Doering
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 <[email protected]...>--- src/openvpn/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)src/openvpn/route.c +0
-0@@ -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.
src/openvpn/route.c do_route_ipv6_service(const bool add, const struct route_ipv6 *r, const struct t · line 3067
Quoted 5 lines
src/openvpn/route.c +3
-1+* (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 )
{Quoted 3 lines
inet_pton(AF_INET6, "fe80::8", &msg.gateway.ipv6);
}This should fix it. ACK.
Selva
Got it tested by now, works :-)
Patch has been applied to the master and release/2.4 branch.
commit 27740b376c1ca89a43dcff5c8309f1e1afecc5c9 (master) commit 46e65494194f0bba0c63be8360b56ed595949720 (release/2.4)
Author: Gert Doering Date: Sun Mar 19 20:10:49 2017 +0100
Fix installation of IPv6 host route to VPN server when using iservice.
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: Selva Nair <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg14282.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering