kernel-pfroute: Activate TUN device before setting address
authorTobias Brunner <tobias@strongswan.org>
Sat, 15 Jun 2013 16:56:11 +0000 (18:56 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 21 Jun 2013 15:03:21 +0000 (17:03 +0200)
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.

src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c

index 520f52a..d6fd33a 100644 (file)
@@ -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;