diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-03-15 18:26:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-15 18:26:43 -0400 |
commit | 7313714775a6411402f63261c05fbb4ee3d5b64a (patch) | |
tree | ef2983b19f31ba0743911d69f82d0aa252f10913 /net | |
parent | c337ffb68e1e71bad069b14d2246fa1e0c31699c (diff) |
xfrm: fix __xfrm_route_forward()
This function should return 0 in case of error, 1 if OK
commit 452edd598f60522 (xfrm: Return dst directly from xfrm_lookup())
got it wrong.
Reported-and-bisected-by: Michael Smith <msmith@cbnco.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 1ba0258b49c7..027e3c6fb7e4 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2175,7 +2175,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2175 | struct net *net = dev_net(skb->dev); | 2175 | struct net *net = dev_net(skb->dev); |
2176 | struct flowi fl; | 2176 | struct flowi fl; |
2177 | struct dst_entry *dst; | 2177 | struct dst_entry *dst; |
2178 | int res = 0; | 2178 | int res = 1; |
2179 | 2179 | ||
2180 | if (xfrm_decode_session(skb, &fl, family) < 0) { | 2180 | if (xfrm_decode_session(skb, &fl, family) < 0) { |
2181 | XFRM_INC_STATS(net, LINUX_MIB_XFRMFWDHDRERROR); | 2181 | XFRM_INC_STATS(net, LINUX_MIB_XFRMFWDHDRERROR); |
@@ -2186,7 +2186,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2186 | 2186 | ||
2187 | dst = xfrm_lookup(net, skb_dst(skb), &fl, NULL, 0); | 2187 | dst = xfrm_lookup(net, skb_dst(skb), &fl, NULL, 0); |
2188 | if (IS_ERR(dst)) { | 2188 | if (IS_ERR(dst)) { |
2189 | res = 1; | 2189 | res = 0; |
2190 | dst = NULL; | 2190 | dst = NULL; |
2191 | } | 2191 | } |
2192 | skb_dst_set(skb, dst); | 2192 | skb_dst_set(skb, dst); |