From 4ab1ffa0b042e4fda87d66de2fd74a1e6db48272 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 7 Jan 2015 09:11:58 -0200 Subject: [PATCH] Fix #4146: OpenVPN create the tun/tap interface and, when set an IP address to it, mark it as UP. In some scenarios, when TAP is set as bridge and doesn't have an IP address set on it, it never goes up and tunnel doesn't work. If rc.newwanip is called for this TAP interface, UP flag is set, but, rc.newwanip is not executed when system is booting. Since it's always rename the interface and add it the group, make sure it's up here. --- etc/inc/openvpn.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index c45256a805..2495cdeafb 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -443,8 +443,8 @@ function openvpn_reconfigure($mode, $settings) { /* rename the device */ mwexec("/sbin/ifconfig " . escapeshellarg($tunname) . " name " . escapeshellarg($devname)); - /* add the device to the openvpn group */ - mwexec("/sbin/ifconfig " . escapeshellarg($devname) . " group openvpn"); + /* add the device to the openvpn group and make sure it's UP*/ + mwexec("/sbin/ifconfig " . escapeshellarg($devname) . " group openvpn up"); $ifname = convert_real_interface_to_friendly_interface_name($devname); $grouptmp = link_interface_to_group($ifname);