Esempio n. 1
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();
	}
}
Esempio n. 2
0
void wan6_down(char *wan_ifname)
{
	int ipv6_type;
	char *wan6_ifname;

	ipv6_type = get_ipv6_type();
	if (ipv6_type == IPV6_DISABLED)
		return;

	stop_radvd();
	stop_dhcp6c();
	control_if_ipv6_radv(wan_ifname, 0);
	control_if_ipv6_autoconf(wan_ifname, 0);

	if (ipv6_type == IPV6_6IN4 || ipv6_type == IPV6_6TO4 || ipv6_type == IPV6_6RD)
	{
		wan6_ifname = IFNAME_SIT;
		if (is_interface_exist(IFNAME_SIT))
			doSystem("ip link set dev %s down", IFNAME_SIT);
	}
	else
	{
		wan6_ifname = wan_ifname;
	}

	// clear WAN routes6
	clear_if_route6(wan6_ifname);

	// clear WAN addr6
	clear_if_addr6(wan6_ifname);

	// delete SIT tunnel
	stop_sit_tunnel();

	// clear DNS6 for resolv.conf
	nvram_set("wan0_dns6", "");
}