Esempio n. 1
0
static void
on_client_ifdown(void)
{
	nvram_set_int_temp("vpnc_state_t", 0);

	restore_dns_from_vpnc();
}
Esempio n. 2
0
static void
on_client_ifdown(void)
{
    nvram_set_int_temp("vpnc_state_t", 0);

    restore_dns_from_vpnc();

    call_client_script(VPN_CLIENT_UPDOWN_SCRIPT, "down");
}
Esempio n. 3
0
static void
on_client_ifdown(void)
{
	int i;
	char *script_name = VPN_CLIENT_UPDOWN_SCRIPT;

	nvram_set_int_temp("vpnc_state_t", 0);

	restore_dns_from_vpnc();

	if (check_if_file_exist(script_name)) {
		for (i = 0; i < ARRAY_SIZE(env_ovpn); i++)
			setenv(env_pppd[i], safe_getenv(env_ovpn[i]), 1);
		doSystem("%s %s", script_name, "down");
		for (i = 0; i < ARRAY_SIZE(env_ovpn); i++)
			unsetenv(env_pppd[i]);
	}
}
Esempio n. 4
0
void
restart_vpn_client(void)
{
	xl2tpd_killed_vpnc = 0;

	stop_vpn_client_force();
	stop_vpn_client();

	restore_dns_from_vpnc();

	sleep(1);
	start_vpn_client();

	restart_firewall();

	/* restore L2TP WAN client or L2TP VPNS */
	if (xl2tpd_killed_vpnc && (nvram_match("l2tp_wan_t", "1") || nvram_match("l2tp_srv_t", "1")))
		safe_start_xl2tpd();
}
Esempio n. 5
0
int
ipdown_vpnc_main(int argc, char **argv)
{
	char *script_name = VPN_CLIENT_UPDOWN_SCRIPT;
	char *ifname = safe_getenv("IFNAME");
	char *gw = getenv("IPREMOTE");

	umask(0000);

	vpnc_route_dgw(ifname, gw, 0);
	vpnc_route_to_remote_lan(ifname, gw, 0);

	nvram_set_int_temp("vpnc_state_t", 0);

	restore_dns_from_vpnc();

	if (check_if_file_exist(script_name))
		doSystem("%s %s", script_name, "down");

	return 0;
}