--- zzzz-none-000/linux-2.6.28.10/net/ipv6/route.c 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/net/ipv6/route.c 2009-12-08 17:45:42.000000000 +0000 @@ -1705,8 +1705,17 @@ { struct rt6_info *rt; struct fib6_table *table; - +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + u32 dflt_table = RT6_TABLE_DFLT; + struct inet6_dev *idev; + + if ((idev = __in6_dev_get(dev)) != NULL && + idev->cnf.ra_defrtr_table != RT6_TABLE_UNSPEC) + dflt_table = idev->cnf.ra_defrtr_table; + table = fib6_get_table(dev_net(dev), dflt_table); +#else table = fib6_get_table(dev_net(dev), RT6_TABLE_DFLT); +#endif if (table == NULL) return NULL; @@ -1737,6 +1746,13 @@ .fc_nlinfo.nlh = NULL, .fc_nlinfo.nl_net = dev_net(dev), }; +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + struct inet6_dev *idev; + + if ((idev = __in6_dev_get(dev)) != NULL && + idev->cnf.ra_defrtr_table != RT6_TABLE_UNSPEC) + cfg.fc_table = idev->cnf.ra_defrtr_table; +#endif ipv6_addr_copy(&cfg.fc_gateway, gwaddr); @@ -1745,6 +1761,22 @@ return rt6_get_dflt_router(gwaddr, dev); } +#ifdef CONFIG_IPV6_MULTIPLE_TABLES +static int fib6_dflt_router(struct rt6_info *rt, void *arg) +{ + if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) { + dst_hold(&rt->u.dst); + RT6_TRACE("deleted by purge_dflt_routers %p\n", rt); + return -1; + } + return 0; +} + +void rt6_purge_dflt_routers(struct net *net) +{ + fib6_clean_all(net, fib6_dflt_router, 0, 0); +} +#else void rt6_purge_dflt_routers(struct net *net) { struct rt6_info *rt; @@ -1767,6 +1799,7 @@ } read_unlock_bh(&table->tb6_lock); } +#endif static void rtmsg_to_fib6_config(struct net *net, struct in6_rtmsg *rtmsg,