Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Commit

Permalink
openvpn: apply policy rules at boot time (so clients that are forced …
Browse files Browse the repository at this point in the history
…through the tunnel will be blocked at boot time); minor memory optimization
  • Loading branch information
RMerl committed May 30, 2015
1 parent c682a70 commit db040fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion release/src/router/rc/openvpn.c
Expand Up @@ -1515,6 +1515,10 @@ void start_vpn_eas()
start_vpnserver(nums[i]);
}

// Setup client routing in case some are set to be blocked when tunnel is down
update_vpnrouting(1);
update_vpnrouting(2);

// Parse and start clients
strlcpy(&buffer[0], nvram_safe_get("vpn_clientx_eas"), sizeof(buffer));
if ( strlen(&buffer[0]) != 0 ) vpnlog(VPN_LOG_INFO, "Starting clients (eas): %s", &buffer[0]);
Expand Down Expand Up @@ -1777,7 +1781,7 @@ int check_ovpn_client_enabled(int unit){
}

void update_vpnrouting(int unit){
char tmp[64];
char tmp[56];
snprintf(tmp, sizeof (tmp), "dev=tun1%d script_type=rmupdate /usr/sbin/vpnrouting.sh", unit);
system(tmp);
}
Expand Down

0 comments on commit db040fb

Please sign in to comment.