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.
This commit is contained in:
Renato Botelho 2015-01-07 09:11:58 -02:00
parent be2d7eb7c6
commit 4ab1ffa0b0

View File

@ -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);