From: Antonio Quartulli Date: Tue, 31 Jan 2017 11:21:31 +0000 (+0800) Subject: attempt to add IPv6 route even when no IPv6 address was configured X-Git-Tag: v2.5_beta1~745 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b7650e7ec9241745e4f66c932d6cffaece927d7;p=thirdparty%2Fopenvpn.git attempt to add IPv6 route even when no IPv6 address was configured Even if no IPv6 address is configured, OpenVPN still supports transporting IPv6 segments, therefore adding an IPv6 route should always be allowed. However, the route might fail to be installed or may just not work as expected, therefore, a proper warning should be printed to inform the user of the possible pitfall. Always allow adding an IPv6 route and print a WARNING when no IPv6 address is configured for the interface. Trac: #832 Signed-off-by: Antonio Quartulli Acked-by: Gert Doering Message-Id: <20170131112131.13570-1-a@unstable.cc> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13994.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 223cb5f4c..0145db3c6 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1196,6 +1196,15 @@ add_routes(struct route_list *rl, struct route_ipv6_list *rl6, const struct tunt if (rl6 && !(rl6->iflags & RL_ROUTES_ADDED) ) { struct route_ipv6 *r; + + if (!tt->did_ifconfig_ipv6_setup) + { + msg(M_INFO, "WARNING: OpenVPN was configured to add an IPv6 " + "route over %s. However, no IPv6 has been configured for " + "this interface, therefore the route installation may " + "fail or may not work as expected.", tt->actual_name); + } + for (r = rl6->routes_ipv6; r; r = r->next) { if (flags & ROUTE_DELETE_FIRST) @@ -1882,14 +1891,6 @@ add_route_ipv6(struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flag } #endif - if (!tt->did_ifconfig_ipv6_setup) - { - msg( M_INFO, "add_route_ipv6(): not adding %s/%d: " - "no IPv6 address been configured on interface %s", - network, r6->netbits, device); - return; - } - msg( M_INFO, "add_route_ipv6(%s/%d -> %s metric %d) dev %s", network, r6->netbits, gateway, r6->metric, device );