From: Gert Doering Date: Wed, 22 Sep 2010 20:18:35 +0000 (+0200) Subject: bugfix for linux/iproute2: IPv6 ifconfig code block was not called for X-Git-Tag: v2.3-alpha1~239^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfa5b2bf34733157a1b1c18313864250c7f8bf9a;p=thirdparty%2Fopenvpn.git bugfix for linux/iproute2: IPv6 ifconfig code block was not called for "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 --- diff --git a/tun.c b/tun.c index 9c464bcc9..52c875e10 100644 --- 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,