Skip to content

Commit

Permalink
neigh: check error pointer instead of NULL for ipv4_neigh_lookup()
Browse files Browse the repository at this point in the history
Fixes: commit f187bc6 ("ipv4: No need to set generic neighbour pointer")
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Sep 28, 2014
1 parent 86fa9c4 commit 2c1a431
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (n) {
if (!IS_ERR(n)) {
if (!(n->nud_state & NUD_VALID)) {
neigh_event_send(n, NULL);
} else {
Expand Down

0 comments on commit 2c1a431

Please sign in to comment.