kernel-pfroute: Activate TUN device before setting address

On FreeBSD, for some reason, we don't learn the interface is up
otherwise.  Even though ifconfig lists it as up at the same time.
This commit is contained in:
Tobias Brunner
2013-06-21 17:03:21 +02:00
parent c8a56512a6
commit 93e4df3761
@@ -837,7 +837,7 @@ METHOD(kernel_net_t, add_ip, status_t,
{
prefix = vip->get_address(vip).len * 8;
}
if (!tun->set_address(tun, vip, prefix) || !tun->up(tun))
if (!tun->up(tun) || !tun->set_address(tun, vip, prefix))
{
tun->destroy(tun);
return FAILED;