[IPV6]: ROUTE: More strict check for default routers in rt6_get_dflt_router().
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Tue, 21 Mar 2006 01:00:48 +0000 (17:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 01:00:48 +0000 (17:00 -0800)
Check RTF_ADDRCONF|RTF_DEFAULT in rt6_get_dflt_router().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index f71e2365b43d9b8248e000506b38d4d5be99de5e..ea6eb44618e77faf35f6c5e04d08150a88d356b7 100644 (file)
@@ -1248,6 +1248,7 @@ struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *d
        write_lock_bh(&rt6_lock);
        for (rt = fn->leaf; rt; rt=rt->u.next) {
                if (dev == rt->rt6i_dev &&
+                   ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) &&
                    ipv6_addr_equal(&rt->rt6i_gateway, addr))
                        break;
        }