ndisc: Do not try to update "updated" time if neighbour has already gone.
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Mon, 21 Jan 2013 09:58:50 +0000 (09:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jan 2013 20:41:41 +0000 (15:41 -0500)
Commit 2152caea ("ipv6: Do not depend on rt->n in rt6_probe().")
introduce a bug to try to update "updated" time in neighbour
structure.
Update the "updated" time only if neighbour is available.

Bug was found by Dan Carpenter <dan.carpenter@oracle.com>

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

index 2d94d5a7a051fb5fb307e2e5f959444ac5eccf44..f3328bc1174f0d3d7825c17bc76e4ae9b5c0a9f2 100644 (file)
@@ -492,10 +492,10 @@ static void rt6_probe(struct rt6_info *rt)
                struct in6_addr mcaddr;
                struct in6_addr *target;
 
-               neigh->updated = jiffies;
-
-               if (neigh)
+               if (neigh) {
+                       neigh->updated = jiffies;
                        write_unlock(&neigh->lock);
+               }
 
                target = (struct in6_addr *)&rt->rt6i_gateway;
                addrconf_addr_solict_mult(target, &mcaddr);