]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
repair tap mode on OpenSolaris/OpenIndiana
authorGert Doering <gert@greenie.muc.de>
Wed, 9 Oct 2019 09:51:59 +0000 (11:51 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 9 Oct 2019 11:42:01 +0000 (13:42 +0200)
commit 611fcbc48 joined the two distinct calls for "add ipv6 address
to tap interface" and "set MTU" for Solaris - but due to peculiarities
on how this platform handles IPv6 addresses ("ifconfig addif" creates
a new "tap0:1" subinterface with the new address - which does not have
a distinct MTU) this does not work.

un-join calls again.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20191009095200.9337-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18905.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c

index 0591df6564e5e7911d227f94e9360330c672d31d..ce23eb6a660f8f5f3e357bdfaee07e4bafc8bc51 100644 (file)
@@ -937,9 +937,11 @@ do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, int tun_mtu,
          * server will ignore the DHCPv6 packets anyway.  So we don't.
          */
 
-        /* static IPv6 addresses need to go to a subinterface (tap0:1) */
-        argv_printf(&argv, "%s %s inet6 addif %s/%d mtu %d up", IFCONFIG_PATH,
-                    ifname, ifconfig_ipv6_local, tt->netbits_ipv6, tun_mtu);
+        /* static IPv6 addresses need to go to a subinterface (tap0:1)
+         * and we cannot set an mtu here (must go to the "parent")
+         */
+        argv_printf(&argv, "%s %s inet6 addif %s/%d up", IFCONFIG_PATH,
+                    ifname, ifconfig_ipv6_local, tt->netbits_ipv6 );
     }
     argv_msg(M_INFO, &argv);
 
@@ -947,6 +949,14 @@ do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, int tun_mtu,
     {
         solaris_error_close(tt, es, ifname, true);
     }
+
+    if (tt->type != DEV_TYPE_TUN)
+    {
+        argv_printf(&argv, "%s %s inet6 mtu %d", IFCONFIG_PATH,
+                    ifname, tun_mtu);
+        argv_msg(M_INFO, &argv);
+        openvpn_execve_check(&argv, es, 0, "Solaris ifconfig IPv6 mtu failed");
+    }
 #elif defined(TARGET_OPENBSD) || defined(TARGET_NETBSD) \
     || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) \
     || defined(TARGET_DRAGONFLY)