From 4936ff53df99f9c3f7de42980b581d21c1838404 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 1 Apr 2011 14:11:33 -0400 Subject: [PATCH] Switch back to dev_mode so existing configs aren't broken by the other changes. --- etc/inc/openvpn.inc | 10 +++++----- usr/local/www/vpn_openvpn_client.php | 8 ++++---- usr/local/www/vpn_openvpn_server.php | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 8d71fd2f41..df531c7d73 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -295,11 +295,11 @@ function openvpn_reconfigure($mode, $settings) { $vpnid = $settings['vpnid']; $mode_id = $mode.$vpnid; - if (isset($settings['device_mode'])) - $tunname = "{$settings['device_mode']}{$vpnid}"; + if (isset($settings['dev_mode'])) + $tunname = "{$settings['dev_mode']}{$vpnid}"; else { /* defaults to tun */ $tunname = "tun{$vpnid}"; - $settings['device_mode'] = "tun"; + $settings['dev_mode'] = "tun"; } if ($mode == "server") @@ -323,7 +323,7 @@ function openvpn_reconfigure($mode, $settings) { $pfile = $g['varrun_path'] . "/openvpn_{$mode_id}.pid"; $proto = ($settings['protocol'] == 'UDP' ? 'udp' : "tcp-{$mode}"); - $device_mode = $settings['device_mode']; + $dev_mode = $settings['dev_mode']; $cipher = $settings['crypto']; $interface = $settings['interface']; @@ -341,7 +341,7 @@ function openvpn_reconfigure($mode, $settings) { } $conf = "dev {$devname}\n"; - $conf .= "dev-type {$settings['device_mode']}\n"; + $conf .= "dev-type {$settings['dev_mode']}\n"; $conf .= "dev-node /dev/{$tunname}\n"; $conf .= "writepid {$pfile}\n"; $conf .= "#user nobody\n"; diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index c355577b63..d28315d029 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -113,7 +113,7 @@ if($_GET['act']=="edit"){ $pconfig['description'] = $a_client[$id]['description']; $pconfig['custom_options'] = $a_client[$id]['custom_options']; $pconfig['ns_cert_type'] = $a_client[$id]['ns_cert_type']; - $pconfig['device_mode'] = $a_client[$id]['device_mode']; + $pconfig['dev_mode'] = $a_client[$id]['dev_mode']; if ($pconfig['mode'] != "p2p_shared_key") { $pconfig['caref'] = $a_client[$id]['caref']; @@ -228,7 +228,7 @@ if ($_POST) { if ($_POST['disable'] == "yes") $client['disable'] = true; $client['protocol'] = $pconfig['protocol']; - $client['device_mode'] = $pconfig['device_mode']; + $client['dev_mode'] = $pconfig['dev_mode']; list($client['interface'], $client['ipaddr']) = explode ("|",$pconfig['interface']); $client['local_port'] = $pconfig['local_port']; $client['server_addr'] = $pconfig['server_addr']; @@ -439,11 +439,11 @@ if ($savemsg) - diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index ef82716a8b..cc38e65ad5 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -91,7 +91,7 @@ if($_GET['act']=="new"){ $pconfig['tlsauth_enable'] = "yes"; $pconfig['autotls_enable'] = "yes"; $pconfig['dh_length'] = 1024; - $pconfig['device_mode'] = "tun"; + $pconfig['dev_mode'] = "tun"; $pconfig['interface'] = "wan"; $pconfig['local_port'] = openvpn_port_next('UDP'); $pconfig['pool_enable'] = "yes"; @@ -105,7 +105,7 @@ if($_GET['act']=="edit"){ $pconfig['mode'] = $a_server[$id]['mode']; $pconfig['protocol'] = $a_server[$id]['protocol']; $pconfig['authmode'] = $a_server[$id]['authmode']; - $pconfig['device_mode'] = $a_server[$id]['device_mode']; + $pconfig['dev_mode'] = $a_server[$id]['dev_mode']; $pconfig['interface'] = $a_server[$id]['interface']; if (!empty($a_server[$id]['ipaddr'])) { $pconfig['interface'] = $pconfig['interface'] . '|' . $a_server[$id]['ipaddr']; @@ -306,7 +306,7 @@ if ($_POST) { if (!empty($pconfig['authmode'])) $server['authmode'] = implode(",", $pconfig['authmode']); $server['protocol'] = $pconfig['protocol']; - $server['device_mode'] = $pconfig['device_mode']; + $server['dev_mode'] = $pconfig['dev_mode']; list($server['interface'], $server['ipaddr']) = explode ("|",$pconfig['interface']); $server['local_port'] = $pconfig['local_port']; $server['description'] = $pconfig['description']; @@ -668,12 +668,12 @@ if ($savemsg) -