net: fix NULL dereferences in check_peer_redir()
[~shefty/rdma-dev.git] / net / ipv6 / ip6_fib.c
index 54a4678955bf57b850a7a3a9fff70d0fed0eaf14..320d91d20ad7ddfd981cee92161482f218c225b4 100644 (file)
@@ -1455,7 +1455,7 @@ static int fib6_age(struct rt6_info *rt, void *arg)
                        RT6_TRACE("aging clone %p\n", rt);
                        return -1;
                } else if ((rt->rt6i_flags & RTF_GATEWAY) &&
-                          (!(dst_get_neighbour(&rt->dst)->flags & NTF_ROUTER))) {
+                          (!(dst_get_neighbour_raw(&rt->dst)->flags & NTF_ROUTER))) {
                        RT6_TRACE("purging route %p via non-router but gateway\n",
                                  rt);
                        return -1;