diff options
author | Ville Nuorvala <vnuorval@tcs.hut.fi> | 2006-10-17 01:10:05 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-18 22:55:27 -0400 |
commit | 4251320fa2ef93207fbefeb2eda2d265b84fc116 (patch) | |
tree | 7d322c9d541f24df4fedc38e964aa906226b52ad /net/ipv6/xfrm6_policy.c | |
parent | 23c435f7ff884caded4a1391ba2b308d465423c0 (diff) |
[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>
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 73cee2ec07e8..d400f8fae129 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -25,12 +25,14 @@ | |||
25 | static struct dst_ops xfrm6_dst_ops; | 25 | static struct dst_ops xfrm6_dst_ops; |
26 | static struct xfrm_policy_afinfo xfrm6_policy_afinfo; | 26 | static struct xfrm_policy_afinfo xfrm6_policy_afinfo; |
27 | 27 | ||
28 | static int xfrm6_dst_lookup(struct xfrm_dst **dst, struct flowi *fl) | 28 | static int xfrm6_dst_lookup(struct xfrm_dst **xdst, struct flowi *fl) |
29 | { | 29 | { |
30 | int err = 0; | 30 | struct dst_entry *dst = ip6_route_output(NULL, fl); |
31 | *dst = (struct xfrm_dst*)ip6_route_output(NULL, fl); | 31 | int err = dst->error; |
32 | if (!*dst) | 32 | if (!err) |
33 | err = -ENETUNREACH; | 33 | *xdst = (struct xfrm_dst *) dst; |
34 | else | ||
35 | dst_release(dst); | ||
34 | return err; | 36 | return err; |
35 | } | 37 | } |
36 | 38 | ||