]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipv4: Fix route refcount on pmtu discovery
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 22 Jan 2013 00:01:28 +0000 (00:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 18:48:32 +0000 (10:48 -0800)
commit4ad45ec2e4660a7643a0434b1db47085532afdb1
treec5b28f7b5d4db4d14341cefb4e38cadee1156e71
parent5874dd2fa88cc8b977b839a70679d61624e89ad4
ipv4: Fix route refcount on pmtu discovery

[ Upstream commit b44108dbdbaa07c609bb5755e8dd6c2035236251 ]

git commit 9cb3a50c (ipv4: Invalidate the socket cached route on
pmtu events if possible) introduced a refcount problem. We don't
get a refcount on the route if we get it from__sk_dst_get(), but
we need one if we want to reuse this route because __sk_dst_set()
releases the refcount of the old route. This patch adds proper
refcount handling for that case. We introduce a 'new' flag to
indicate that we are going to use a new route and we release the
old route only if we replace it by a new one.

Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/route.c