diff options
author | Renato Botelho <renato@netgate.com> | 2017-01-04 19:14:15 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-04 19:14:20 -0200 |
commit | 5fbb0cd7736d3e0da3ac1a916940d38a9921cbcb (patch) | |
tree | a7681c46045616fb73209afe4ba62aad8ff5ea0e /src/usr/local/www/vpn_openvpn_client.php | |
parent | 65bb2289276d6e49d5f2b2bea80cad037c591849 (diff) | |
download | pfsense-5fbb0cd7736d3e0da3ac1a916940d38a9921cbcb.zip pfsense-5fbb0cd7736d3e0da3ac1a916940d38a9921cbcb.tar.gz |
As done on OpenVPN Server, delete tunnel when dev_mode changes so new device is created accordingly
Diffstat (limited to 'src/usr/local/www/vpn_openvpn_client.php')
-rw-r--r-- | src/usr/local/www/vpn_openvpn_client.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/usr/local/www/vpn_openvpn_client.php b/src/usr/local/www/vpn_openvpn_client.php index 3614337..58d3e3b 100644 --- a/src/usr/local/www/vpn_openvpn_client.php +++ b/src/usr/local/www/vpn_openvpn_client.php @@ -350,6 +350,15 @@ if ($_POST) { $client = array(); + if (isset($id) && $a_client[$id] && + $pconfig['dev_mode'] <> $a_client[$id]['dev_mode']) { + /* + * delete old interface so a new TUN or TAP interface + * can be created. + */ + openvpn_delete('client', $a_client[$id]); + } + foreach ($simplefields as $stat) { if (($stat == 'auth_pass') && ($_POST[$stat] == DMYPWD)) { $client[$stat] = $a_client[$id]['auth_pass']; |