[IPV6]: Make sure error handling is done when calling ip6_route_output().

As ip6_route_output() never returns NULL, error checking must be done by
looking at dst->error in stead of comparing dst against NULL.

Signed-off-by: Ville Nuorvala <vnuorval@tcs.hut.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ville Nuorvala
2006-10-16 22:10:05 -07:00
committed by David S. Miller
父節點 23c435f7ff
當前提交 4251320fa2
共有 2 個文件被更改,包括 12 次插入10 次删除

查看文件

@@ -25,12 +25,14 @@
static struct dst_ops xfrm6_dst_ops;
static struct xfrm_policy_afinfo xfrm6_policy_afinfo;
static int xfrm6_dst_lookup(struct xfrm_dst **dst, struct flowi *fl)
static int xfrm6_dst_lookup(struct xfrm_dst **xdst, struct flowi *fl)
{
int err = 0;
*dst = (struct xfrm_dst*)ip6_route_output(NULL, fl);
if (!*dst)
err = -ENETUNREACH;
struct dst_entry *dst = ip6_route_output(NULL, fl);
int err = dst->error;
if (!err)
*xdst = (struct xfrm_dst *) dst;
else
dst_release(dst);
return err;
}