int ip6up_main(int argc, char **argv) { char *wan_ifname; //char *value; int unit; char tmp[100], prefix[WAN_PREFIX_SZ]; if ((unit = ppp_prefix(&wan_ifname, prefix)) < 0) return -1; if (nvram_get_int(strcat_r(prefix, "ipv6_if_x", tmp))) return 0; //if ((value = getenv("LLLOCAL"))) // eval("ip", "-6", "addr", "add", value, "dev", wan_ifname); //if ((value = getenv("LLREMOTE"))) // nvram_set(strcat_r(prefix, "ipv6_router", tmp), value); /* Start IPv6 */ if (nvram_match("ipv6_proto", "native") || nvram_match("ipv6_proto", "dhcp6")) wan6_up(wan_ifname, unit); return 0; }
int ip6up_main(int argc, char **argv) { char *wan_ifname = safe_getenv("IFNAME"); char *llremote = safe_getenv("LLREMOTE"); if (!wan_ifname || strlen(wan_ifname) <= 0) return 0; nvram_set("ipv6_ll_remote", llremote); switch (get_ipv6_service()) { case IPV6_NATIVE: case IPV6_NATIVE_DHCP: wait_ppp_count = 10; while ((!is_intf_up(wan_ifname) || !getifaddr(wan_ifname, AF_INET6, 0)) && (wait_ppp_count-- > 0)) sleep(1); break; default: wait_ppp_count = 0; break; } if (wait_ppp_count != -2) { wan6_up(wan_ifname); start_firewall(0, 0); } return 0; }