Skip to content

Commit

Permalink
ipv6: ip6_route_output() never returns NULL.
Browse files Browse the repository at this point in the history
ip6_route_output() never returns NULL, so it is wrong to
check if the return value is NULL.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
RongQing.Li authored and David S. Miller committed Feb 22, 2012
1 parent ba9adbe commit 5095d64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,10 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
};

dst = ip6_route_output(net, NULL, &fl6);
if (!dst)
if (dst->error) {
dst_release(dst);
goto out_free;
}

skb_dst_drop(skb);
skb_dst_set(skb, dst);
Expand Down
5 changes: 3 additions & 2 deletions net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,9 +1545,10 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
&saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);

dst = ip6_route_output(net, NULL, &fl6);
if (dst == NULL)
if (dst->error) {
dst_release(dst);
return;

}
dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
if (IS_ERR(dst))
return;
Expand Down

0 comments on commit 5095d64

Please sign in to comment.