]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
bugfix for linux/iproute2: IPv6 ifconfig code block was not called for
authorGert Doering <gert@greenie.muc.de>
Wed, 22 Sep 2010 20:18:35 +0000 (22:18 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 24 Apr 2011 15:22:45 +0000 (17:22 +0200)
"dev tun"+"topology subnet" - moved code out of "if (tun)" block, works.

add more debug information to help diagnose cases where IPv6 isn't working
Signed-off-by: Gert Doering <gert@greenie.muc.de>
tun.c

diff --git a/tun.c b/tun.c
index 9c464bcc9c080c06464e88c5fe99e99aab450816..52c875e1010ab396c873735fdbe1fa042f203d12 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -616,7 +616,8 @@ do_ifconfig (struct tuntap *tt,
 
       argv_init (&argv);
 
-      msg( M_INFO, "do_ifconfig, tt->ipv6=%d", tt->ipv6 );
+      msg( M_INFO, "do_ifconfig, tt->ipv6=%d, tt->did_ifconfig_ipv6_setup=%d",
+                  tt->ipv6, tt->did_ifconfig_ipv6_setup );
 
       /*
        * We only handle TUN/TAP devices here, not --dev null devices.
@@ -682,18 +683,6 @@ do_ifconfig (struct tuntap *tt,
                                  );
                  argv_msg (M_INFO, &argv);
                  openvpn_execve_check (&argv, es, S_FATAL, "Linux ip addr add failed");
-                 if ( do_ipv6 )
-                   {
-                     argv_printf( &argv,
-                                 "%s -6 addr add %s/%d dev %s",
-                                 iproute_path,
-                                 ifconfig_ipv6_local,
-                                 tt->netbits_ipv6,
-                                 actual
-                                 );
-                     argv_msg (M_INFO, &argv);
-                     openvpn_execve_check (&argv, es, S_FATAL, "Linux ip -6 addr add failed");
-                   }
        } else {
                argv_printf (&argv,
                                  "%s addr add dev %s %s/%d broadcast %s",
@@ -706,7 +695,19 @@ do_ifconfig (struct tuntap *tt,
                  argv_msg (M_INFO, &argv);
                  openvpn_execve_check (&argv, es, S_FATAL, "Linux ip addr add failed");
        }
-       tt->did_ifconfig = true;
+      if ( do_ipv6 )
+       {
+         argv_printf( &argv,
+                     "%s -6 addr add %s/%d dev %s",
+                     iproute_path,
+                     ifconfig_ipv6_local,
+                     tt->netbits_ipv6,
+                     actual
+                     );
+         argv_msg (M_INFO, &argv);
+         openvpn_execve_check (&argv, es, S_FATAL, "Linux ip -6 addr add failed");
+       }
+      tt->did_ifconfig = true;
 #else
       if (tun)
        argv_printf (&argv,