[IPV6] ROUTE: Fix dst reference counting in ip6_pol_route_lookup().
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Mon, 28 Aug 2006 20:19:30 +0000 (13:19 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:18:26 +0000 (15:18 -0700)
In ip6_pol_route_lookup(), when we finish backtracking at the
top-level root entry, we need to hold it.

Bug noticed by Mitsuru Chinen <CHINEN@jp.ibm.com>.

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

index 75f4bb9..d6b4b4f 100644 (file)
@@ -510,8 +510,8 @@ restart:
        rt = fn->leaf;
        rt = rt6_device_match(rt, fl->oif, flags);
        BACKTRACK(&fl->fl6_src);
-       dst_hold(&rt->u.dst);
 out:
+       dst_hold(&rt->u.dst);
        read_unlock_bh(&table->tb6_lock);
 
        rt->u.dst.lastuse = jiffies;