示例#1
0
static void
inet_handler(int is_ap_mode)
{
    if (!is_ap_mode)
    {
        long i_deferred_wanup = nvram_get_int("deferred_wanup_t");
        if (i_deferred_wanup > 0 && uptime() >= i_deferred_wanup)
        {
            notify_rc("deferred_wan_connect");

            return;
        }

        if (has_wan_ip4(0) && has_wan_gw4())
        {
            /* sync time to ntp server if necessary */
            ntpc_handler();
        }
    }
    else
    {
        if (has_lan_ip4() && has_lan_gw4())
            ntpc_handler();
    }
}
示例#2
0
static void 
inet_handler(void)
{
	if (nvram_match("wan_route_x", "IP_Routed"))
	{
		if (nvram_invmatch("wan_gateway_t", "") && has_wan_ip(0))
		{
			/* sync time to ntp server if necessary */
			ntpc_handler();
		}
	}
	else
	{
		if (nvram_invmatch("lan_gateway_t", ""))
			ntpc_handler();
	}
}