Permalink
Browse files

ovpn: fix strict-order not always being properly applied/removed to d…

…nsmasq's configuration

 o updown.sh script will now properly remove strict-order on tunnel shutdown
   (since get_max_dnsmode() cannot catch it after the tunnel is down)

 o Webui will now also force a dnsmasq restart if changing between strict and other
   modes while client is running, to properly add/remove strict-order from dnsmasq
   (updown.sh can only see the new mode, not the original one)
  • Loading branch information...
RMerl committed Jan 10, 2019
1 parent 7d5c8a7 commit 752b81415bff230a6a53269b5f9cb00db733fa02
Showing with 10 additions and 2 deletions.
  1. +6 −2 release/src/router/others/updown.sh
  2. +4 −0 release/src/router/www/Advanced_OpenVPNClient_Content.asp
@@ -124,8 +124,12 @@ then
/sbin/service updateresolv
elif [ $script_type == 'down' ]; then
rm $dnsscript
/sbin/service updateresolv # also restarts or reloads dnsmasq as necessary
# /sbin/service restart_dnsmasq
if [ $(nvram get vpn_client$(echo $instance)_adns) == 2 ]
then
/sbin/service restart_dnsmasq
else
/sbin/service updateresolv
fi
fi
fi

@@ -157,6 +157,7 @@ switch (openvpn_unit) {
enforce_ori = "<% nvram_get("vpn_client_enforce"); %>";
policy_ori = "<% nvram_get("vpn_client_rgw"); %>";
dnsmode_ori = "<% nvram_get("vpn_client_adns"); %>";
ciphersarray = [
["AES-128-CBC"],
@@ -620,6 +621,9 @@ function applyRule(manual_switch){
(client_state == 0) && (manual_switch == 0))
document.form.action_script.value += "start_vpnrouting"+openvpn_unit;
if ((dnsmode_ori != document.form.vpn_client_adns.value) && (client_state != 0))
document.form.action_script.value += ";restart_dnsmasq"
document.form.submit();
}

0 comments on commit 752b814

Please sign in to comment.