For changing the MTU on tun devices, it should not matter whether it is done via using ifconfig, which uses a SIOCSIFMTU ioctl() command or doing it using a TUNSIFINFO ioctl() command.
Without this patch, for IPv6 the new MTU is not used when creating routes. Especially, when initiating TCP connections after increasing the MTU, the old MTU is still used to compute the MSS.
Please note the the code change is inspired by if.c.
As suggested by ae@, add a corresponding fix to the tap interface.