提交 edfb5d46 编写于 作者: J Jiri Bohac 提交者: David S. Miller

ipv6: fix rt6_update_expires

Commit 1716a961 (ipv6: fix problem with expired dst cache) broke PMTU
discovery. rt6_update_expires() calls dst_set_expires(), which only updates
dst->expires if it has not been set previously (expires == 0) or if the new
expires is earlier than the current dst->expires.

rt6_update_expires() needs to zero rt->dst.expires, otherwise it will contain
ivalid data left over from rt->dst.from and will confuse dst_set_expires().
Signed-off-by: NJiri Bohac <jbohac@suse.cz>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b95465c8
......@@ -143,8 +143,14 @@ static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
static inline void rt6_update_expires(struct rt6_info *rt, int timeout)
{
if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
dst_release(rt->dst.from);
if (!(rt->rt6i_flags & RTF_EXPIRES)) {
if (rt->dst.from)
dst_release(rt->dst.from);
/* dst_set_expires relies on expires == 0
* if it has not been set previously.
*/
rt->dst.expires = 0;
}
dst_set_expires(&rt->dst, timeout);
rt->rt6i_flags |= RTF_EXPIRES;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册