Beispiel #1
0
/* Sometimes, dnsmasq crashed, try to re-run it */
static void
dnsmasq_process_check(void)
{
    if (!is_dns_dhcpd_run())
        dnsmasq_missing++;
    else
        dnsmasq_missing = 0;

    if (dnsmasq_missing > 1) {
        dnsmasq_missing = 0;
        logmessage("watchdog", "dnsmasq is missing, start again!");
        start_dns_dhcpd(0);
    }
}
Beispiel #2
0
void full_restart_ipv6(int ipv6_type_old)
{
	int ipv6_type = get_ipv6_type();
	int ipv6_toggled = ((ipv6_type == IPV6_DISABLED || ipv6_type_old == IPV6_DISABLED) && (ipv6_type != ipv6_type_old)) ? 1 : 0;

	if (ipv6_toggled) {
		stop_lltd();
		stop_httpd();
	}

	stop_upnp();
	stop_dhcp6c();
	stop_dns_dhcpd();

	if (ipv6_type == IPV6_DISABLED) {
		clear_all_route6();
		clear_all_addr6();
		clear_if_neigh6(IFNAME_BR);
		stop_sit_tunnel();
		reset_lan6_vars();
		reset_wan6_vars();
		control_if_ipv6_all(0);
		set_libc_gai(1);
		update_resolvconf(0, 1);
		reload_nat_modules();
		restart_firewall();
		start_dns_dhcpd(0);
	} else {
		set_libc_gai(0);
		control_if_ipv6_all(1);
		clear_all_addr6();
		reset_lan6_vars();
		reload_lan_addr6();
		full_restart_wan();
		if (!is_dns_dhcpd_run())
			start_dns_dhcpd(0);
	}

	if (ipv6_toggled) {
		start_httpd(0);
		start_lltd();
	}
}