]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv6/route.c
[IPV6]: Fix route lifetime.
[net-next-2.6.git] / net / ipv6 / route.c
index 5d5bbb49ec7893811743477e45ed1e6a651b2115..7c68bfbee36193caca29325ad160d5be62c73265 100644 (file)
@@ -483,7 +483,7 @@ restart:
                goto out;
        }
 
-       rt = rt6_device_match(rt, skb->dev->ifindex, 0);
+       rt = rt6_device_match(rt, skb->dev->ifindex, strict);
        BACKTRACK();
 
        if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) {
@@ -829,7 +829,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh,
        }
 
        rt->u.dst.obsolete = -1;
-       rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info);
+       rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info);
        if (nlh && (r = NLMSG_DATA(nlh))) {
                rt->rt6i_protocol = r->rtm_protocol;
        } else {
@@ -1701,16 +1701,14 @@ static void fib6_dump_end(struct netlink_callback *cb)
                fib6_walker_unlink(w);
                kfree(w);
        }
-       if (cb->args[1]) {
-               cb->done = (void*)cb->args[1];
-               cb->args[1] = 0;
-       }
+       cb->done = (void*)cb->args[1];
+       cb->args[1] = 0;
 }
 
 static int fib6_dump_done(struct netlink_callback *cb)
 {
        fib6_dump_end(cb);
-       return cb->done(cb);
+       return cb->done ? cb->done(cb) : 0;
 }
 
 int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)