From: Tobias Brunner Date: Sat, 15 Jun 2013 16:56:11 +0000 (+0200) Subject: kernel-pfroute: Activate TUN device before setting address X-Git-Tag: 5.1.0dr1~80^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93e4df3761bc496a1bae71705f13f3f5a29288ed;p=thirdparty%2Fstrongswan.git 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. --- diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index 520f52a6cf..d6fd33a445 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -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;