--- zzzz-none-000/linux-2.6.28.10/net/ipv6/addrconf.c 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/net/ipv6/addrconf.c 2012-02-14 14:37:49.000000000 +0000 @@ -174,6 +174,9 @@ #endif .max_addresses = IPV6_MAX_ADDRESSES, .accept_ra_defrtr = 1, +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + .ra_defrtr_table = RT6_TABLE_UNSPEC, +#endif .accept_ra_pinfo = 1, #ifdef CONFIG_IPV6_ROUTER_PREF .accept_ra_rtr_pref = 1, @@ -208,6 +211,9 @@ #endif .max_addresses = IPV6_MAX_ADDRESSES, .accept_ra_defrtr = 1, +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + .ra_defrtr_table = RT6_TABLE_UNSPEC, +#endif .accept_ra_pinfo = 1, #ifdef CONFIG_IPV6_ROUTER_PREF .accept_ra_rtr_pref = 1, @@ -1757,6 +1763,9 @@ if ((idev = ipv6_find_idev(dev)) == NULL) return NULL; + if (idev->cnf.disable_ipv6) + return idev; + /* Add default multicast route */ addrconf_add_mroute(dev); @@ -2355,6 +2364,9 @@ if (idev == NULL) return; + if (idev->cnf.disable_ipv6) + return; + memset(&addr, 0, sizeof(struct in6_addr)); addr.s6_addr32[0] = htonl(0xFE800000); @@ -2485,6 +2497,7 @@ if (idev) { idev->if_flags |= IF_READY; + if (!idev->cnf.disable_ipv6) run_pending = 1; } } else { @@ -2506,7 +2519,8 @@ "link becomes ready\n", dev->name); - run_pending = 1; + if (idev && !idev->cnf.disable_ipv6) + run_pending = 1; } switch(dev->type) { @@ -2760,6 +2774,13 @@ else rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); + /* Adding delay since the messages seem to get missed by peer otherwise (as seen while tesing using + * TAHI scripts for IPv6 Ready logo certification) + */ + //rand_num += 1 * HZ; + //TCK: Changed the wait time to 5 seconds to allow interface to come up completely before DADs + rand_num += (5*HZ); + ifp->probes = idev->cnf.dad_transmits; addrconf_mod_timer(ifp, AC_DAD, rand_num); } @@ -2873,10 +2894,18 @@ start sending router solicitations. */ +#ifdef CONFIG_IPV6_CPE_RFC_6204 + if ((ifp->idev->cnf.forwarding == 0 || + ifp->idev->cnf.forwarding == 2) && + ifp->idev->cnf.rtr_solicits > 0 && + (dev->flags&IFF_LOOPBACK) == 0 && + (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { +#else if (ifp->idev->cnf.forwarding == 0 && ifp->idev->cnf.rtr_solicits > 0 && (dev->flags&IFF_LOOPBACK) == 0 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { +#endif /* * If a host as already performed a random delay * [...] as part of DAD [...] there is no need @@ -3070,6 +3099,30 @@ } #endif +#if defined(CONFIG_MACH_FUSIV) +/* + * Get net device if v6 address is configured on any interface + */ +struct net_device *ipv6_dev_find(struct net *net, struct in6_addr *addr) +{ + struct net_device *dev = NULL; + struct inet6_ifaddr * ifp; + u8 hash = ipv6_addr_hash(addr); + read_lock_bh(&addrconf_hash_lock); + for (ifp = inet6_addr_lst[hash]; ifp; ifp = ifp->lst_next) { + if (!net_eq(dev_net(ifp->idev->dev), net)) + continue; + if (ipv6_addr_equal(&ifp->addr, addr)) { + dev = ifp->idev->dev; + break; + } + } + read_unlock_bh(&addrconf_hash_lock); + return dev; +} +EXPORT_SYMBOL(ipv6_dev_find); +#endif + /* * Periodic address status verification */ @@ -4176,6 +4229,16 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + { + .ctl_name = NET_IPV6_RA_DEFRTR_TABLE, + .procname = "ra_defrtr_table", + .data = &ipv6_devconf.ra_defrtr_table, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, +#endif { .ctl_name = NET_IPV6_ACCEPT_RA_PINFO, .procname = "accept_ra_pinfo",