From: David Ahern Date: Wed, 17 Jul 2019 22:08:43 +0000 (-0700) Subject: ipv6: rt6_check should return NULL if 'from' is NULL X-Git-Tag: v5.2.4~62 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2cc82af89d1f4c47aafb16cbfbfe9bb659eaeafb;p=users%2Fdwmw2%2Flinux.git ipv6: rt6_check should return NULL if 'from' is NULL [ Upstream commit 49d05fe2c9d1b4a27761c9807fec39b8155bef9e ] Paul reported that l2tp sessions were broken after the commit referenced in the Fixes tag. Prior to this commit rt6_check returned NULL if the rt6_info 'from' was NULL - ie., the dst_entry was disconnected from a FIB entry. Restore that behavior. Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes") Reported-by: Paul Donohue Tested-by: Paul Donohue Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 97a843cf164cd..5f5a0a42ce60f 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2215,7 +2215,7 @@ static struct dst_entry *rt6_check(struct rt6_info *rt, { u32 rt_cookie = 0; - if ((from && !fib6_get_cookie_safe(from, &rt_cookie)) || + if (!from || !fib6_get_cookie_safe(from, &rt_cookie) || rt_cookie != cookie) return NULL;