Browse code

Delete the IPv6 route to the "connected" network on tun close

This was missing on Windows when interactive service is in use.

v3: Mar 1, 2017: avoid code repetition and rebase to master

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1519936484-26102-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16598.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Selva Nair authored on 2018/03/02 05:34:44
Showing 1 changed files
... ...
@@ -6185,6 +6185,9 @@ close_tun(struct tuntap *tt)
6185 6185
     {
6186 6186
         if (tt->did_ifconfig_ipv6_setup)
6187 6187
         {
6188
+            /* remove route pointing to interface */
6189
+            delete_route_connected_v6_net(tt, NULL);
6190
+
6188 6191
             if (tt->options.msg_channel)
6189 6192
             {
6190 6193
                 do_address_service(false, AF_INET6, tt);
... ...
@@ -6198,9 +6201,6 @@ close_tun(struct tuntap *tt)
6198 6198
                 const char *ifconfig_ipv6_local;
6199 6199
                 struct argv argv = argv_new();
6200 6200
 
6201
-                /* remove route pointing to interface */
6202
-                delete_route_connected_v6_net(tt, NULL);
6203
-
6204 6201
                 /* "store=active" is needed in Windows 8(.1) to delete the
6205 6202
                  * address we added (pointed out by Cedric Tabary).
6206 6203
                  */