Subject: Re: linux-3.0.x regression with ipv4 routes having mtu

From: Steffen Klassert <[email-masked]>
Date: Tue, 20 Dec 2011 09:03:41 +0100

On Mon, Dec 19, 2011 at 03:09:03PM -0500, David Miller wrote:
> 
> Actually, adding yet another ID is pointless.
> 
> Just get rid of redirect_genid, and use net->ipv4.rt_genid for all of
> the necessary purposes.  

I already thought about such a solution, but is this really save?

What if somebody adds/deletes/flushes routes? rt_cache_invalidate()
is invoked and we increment net->ipv4.rt_genid. Then an icmp redirect
may appear and we call ip_rt_redirect() which sets the id on the
inetpeer to the new value of net->ipv4.rt_genid. After that,
ipv4_validate_peer() will find the generation id in proper state
and does not invalidate the learned pmtu value.

I think we could either have two separate generation ids for
pmtu and redirect handling, or we could handle both cases together
by accumulating check_peer_redir() and check_peer_pmtu() into a
check_peer() function. But the latter seems to be a bit too extensive
for a simple bug fix.