From cc132d695609973d80b2edbc4cc654d95d72dde7 Mon Sep 17 00:00:00 2001 From: Gert Doering Date: Wed, 9 Oct 2019 11:51:59 +0200 Subject: [PATCH] repair tap mode on OpenSolaris/OpenIndiana 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 Acked-by: Antonio Quartulli 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 --- src/openvpn/tun.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 0591df656..ce23eb6a6 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -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) -- 2.47.2