mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Switch back to dev_mode so existing configs aren't broken by the other changes.
This commit is contained in:
parent
681b43b079
commit
4936ff53df
@ -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";
|
||||
|
||||
@ -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)
|
||||
<tr>
|
||||
<td width="22%" valign="top" class="vncellreq"><?=gettext("Device mode");?></td>
|
||||
<td width="78%" class="vtable">
|
||||
<select name='device_mode' class="formselect">
|
||||
<select name='dev_mode' class="formselect">
|
||||
<?php
|
||||
foreach ($openvpn_dev_mode as $mode):
|
||||
$selected = "";
|
||||
if ($pconfig['device_mode'] == $mode)
|
||||
if ($pconfig['dev_mode'] == $mode)
|
||||
$selected = "selected";
|
||||
?>
|
||||
<option value="<?=$mode;?>" <?=$selected;?>><?=$mode;?></option>
|
||||
|
||||
@ -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)
|
||||
<tr>
|
||||
<td width="22%" valign="top" class="vncellreq"><?=gettext("Device Mode"); ?></td>
|
||||
<td width="78%" class="vtable">
|
||||
<select name="device_mode" class="formselect">
|
||||
<select name="dev_mode" class="formselect">
|
||||
<?php
|
||||
foreach ($openvpn_dev_mode as $device):
|
||||
$selected = "";
|
||||
if (! empty($pconfig['device_mode'])) {
|
||||
if ($pconfig['device_mode'] == $device)
|
||||
if (! empty($pconfig['dev_mode'])) {
|
||||
if ($pconfig['dev_mode'] == $device)
|
||||
$selected = "selected";
|
||||
} else {
|
||||
if ($device == "tun")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user