Skip to content

Commit

Permalink
ipv6: fix rt6_update_expires
Browse files Browse the repository at this point in the history
Commit 1716a96 (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: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Bohac authored and David S. Miller committed Apr 18, 2012
1 parent b95465c commit edfb5d4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit edfb5d4

Please sign in to comment.