Message ID | 1345582019.5158.547.camel@edumazet-glaptop |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
Hello, On Tue, 21 Aug 2012, Eric Dumazet wrote: > > dst_update_expires will be like dst_set_expires > > but with this difference (time_after): > > > > if (dst->expires == 0 || time_after(expires, dst->expires) || > > !timeout) > > Hmm, all these tests are not really needed, what about : > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index e4ba974..8d6d320 100644 > --- a/net/ipv4/route.c > +++ b/net/ipv4/route.c > @@ -956,7 +956,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, > dst->obsolete = DST_OBSOLETE_KILL; > } else { > rt->rt_pmtu = mtu; > - dst_set_expires(&rt->dst, ip_rt_mtu_expires); > + rt->dst.expires = max(1UL, jiffies + ip_rt_mtu_expires); The best solution, I think. > } > } Regards -- Julian Anastasov <ja@ssi.bg> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e4ba974..8d6d320 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -956,7 +956,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, dst->obsolete = DST_OBSOLETE_KILL; } else { rt->rt_pmtu = mtu; - dst_set_expires(&rt->dst, ip_rt_mtu_expires); + rt->dst.expires = max(1UL, jiffies + ip_rt_mtu_expires); } }