IPv6 routes are rejected on Linux 4.16+
Linux kernel commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=955ec4cb3b54c ("net/ipv6: Do not allow route add with a device that is down") rejects attempts to install an IPv6 route on an interface that is not yet up. This commit is first included in kernel 4.16.
The current code in os_set_ipv6_addr
brings up the interface only after attempting to install the IPv6 route. On kernel 4.16 or later, this fails with the error "Error setting route to remote IPv6: Network is down".
Reordering the calls to bring the interface up before installing the IPv6 route fixes the problem. A pull request will be submitted shortly.