Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c1a4311 authored by WANG Cong's avatar WANG Cong Committed by David S. Miller
Browse files

neigh: check error pointer instead of NULL for ipv4_neigh_lookup()



Fixes: commit f187bc6e ("ipv4: No need to set generic neighbour pointer")
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 86fa9c42
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -746,7 +746,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow
	}
	}


	n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw);
	n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw);
	if (n) {
	if (!IS_ERR(n)) {
		if (!(n->nud_state & NUD_VALID)) {
		if (!(n->nud_state & NUD_VALID)) {
			neigh_event_send(n, NULL);
			neigh_event_send(n, NULL);
		} else {
		} else {