diff options
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_input.c | 3 | ||||
-rw-r--r-- | net/xfrm/xfrm_output.c | 21 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 8 |
3 files changed, 19 insertions, 13 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index b4a13178fb40..e0009c17d809 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
@@ -251,8 +251,7 @@ resume: | |||
251 | nf_reset(skb); | 251 | nf_reset(skb); |
252 | 252 | ||
253 | if (decaps) { | 253 | if (decaps) { |
254 | dst_release(skb->dst); | 254 | skb_dst_drop(skb); |
255 | skb->dst = NULL; | ||
256 | netif_rx(skb); | 255 | netif_rx(skb); |
257 | return 0; | 256 | return 0; |
258 | } else { | 257 | } else { |
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index c235597ba8dd..b9fe13138c07 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
@@ -22,7 +22,7 @@ static int xfrm_output2(struct sk_buff *skb); | |||
22 | 22 | ||
23 | static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) | 23 | static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) |
24 | { | 24 | { |
25 | struct dst_entry *dst = skb->dst; | 25 | struct dst_entry *dst = skb_dst(skb); |
26 | int nhead = dst->header_len + LL_RESERVED_SPACE(dst->dev) | 26 | int nhead = dst->header_len + LL_RESERVED_SPACE(dst->dev) |
27 | - skb_headroom(skb); | 27 | - skb_headroom(skb); |
28 | int ntail = dst->dev->needed_tailroom - skb_tailroom(skb); | 28 | int ntail = dst->dev->needed_tailroom - skb_tailroom(skb); |
@@ -39,7 +39,7 @@ static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) | |||
39 | 39 | ||
40 | static int xfrm_output_one(struct sk_buff *skb, int err) | 40 | static int xfrm_output_one(struct sk_buff *skb, int err) |
41 | { | 41 | { |
42 | struct dst_entry *dst = skb->dst; | 42 | struct dst_entry *dst = skb_dst(skb); |
43 | struct xfrm_state *x = dst->xfrm; | 43 | struct xfrm_state *x = dst->xfrm; |
44 | struct net *net = xs_net(x); | 44 | struct net *net = xs_net(x); |
45 | 45 | ||
@@ -94,12 +94,13 @@ resume: | |||
94 | goto error_nolock; | 94 | goto error_nolock; |
95 | } | 95 | } |
96 | 96 | ||
97 | if (!(skb->dst = dst_pop(dst))) { | 97 | dst = dst_pop(dst); |
98 | if (!dst) { | ||
98 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); | 99 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); |
99 | err = -EHOSTUNREACH; | 100 | err = -EHOSTUNREACH; |
100 | goto error_nolock; | 101 | goto error_nolock; |
101 | } | 102 | } |
102 | dst = skb->dst; | 103 | skb_dst_set(skb, dst); |
103 | x = dst->xfrm; | 104 | x = dst->xfrm; |
104 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); | 105 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); |
105 | 106 | ||
@@ -119,16 +120,16 @@ int xfrm_output_resume(struct sk_buff *skb, int err) | |||
119 | while (likely((err = xfrm_output_one(skb, err)) == 0)) { | 120 | while (likely((err = xfrm_output_one(skb, err)) == 0)) { |
120 | nf_reset(skb); | 121 | nf_reset(skb); |
121 | 122 | ||
122 | err = skb->dst->ops->local_out(skb); | 123 | err = skb_dst(skb)->ops->local_out(skb); |
123 | if (unlikely(err != 1)) | 124 | if (unlikely(err != 1)) |
124 | goto out; | 125 | goto out; |
125 | 126 | ||
126 | if (!skb->dst->xfrm) | 127 | if (!skb_dst(skb)->xfrm) |
127 | return dst_output(skb); | 128 | return dst_output(skb); |
128 | 129 | ||
129 | err = nf_hook(skb->dst->ops->family, | 130 | err = nf_hook(skb_dst(skb)->ops->family, |
130 | NF_INET_POST_ROUTING, skb, | 131 | NF_INET_POST_ROUTING, skb, |
131 | NULL, skb->dst->dev, xfrm_output2); | 132 | NULL, skb_dst(skb)->dev, xfrm_output2); |
132 | if (unlikely(err != 1)) | 133 | if (unlikely(err != 1)) |
133 | goto out; | 134 | goto out; |
134 | } | 135 | } |
@@ -179,7 +180,7 @@ static int xfrm_output_gso(struct sk_buff *skb) | |||
179 | 180 | ||
180 | int xfrm_output(struct sk_buff *skb) | 181 | int xfrm_output(struct sk_buff *skb) |
181 | { | 182 | { |
182 | struct net *net = dev_net(skb->dst->dev); | 183 | struct net *net = dev_net(skb_dst(skb)->dev); |
183 | int err; | 184 | int err; |
184 | 185 | ||
185 | if (skb_is_gso(skb)) | 186 | if (skb_is_gso(skb)) |
@@ -202,7 +203,7 @@ int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb) | |||
202 | struct xfrm_mode *inner_mode; | 203 | struct xfrm_mode *inner_mode; |
203 | if (x->sel.family == AF_UNSPEC) | 204 | if (x->sel.family == AF_UNSPEC) |
204 | inner_mode = xfrm_ip2inner_mode(x, | 205 | inner_mode = xfrm_ip2inner_mode(x, |
205 | xfrm_af2proto(skb->dst->ops->family)); | 206 | xfrm_af2proto(skb_dst(skb)->ops->family)); |
206 | else | 207 | else |
207 | inner_mode = x->inner_mode; | 208 | inner_mode = x->inner_mode; |
208 | 209 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 9c068ab3a834..cb81ca35b0d6 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2027,6 +2027,8 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2027 | { | 2027 | { |
2028 | struct net *net = dev_net(skb->dev); | 2028 | struct net *net = dev_net(skb->dev); |
2029 | struct flowi fl; | 2029 | struct flowi fl; |
2030 | struct dst_entry *dst; | ||
2031 | int res; | ||
2030 | 2032 | ||
2031 | if (xfrm_decode_session(skb, &fl, family) < 0) { | 2033 | if (xfrm_decode_session(skb, &fl, family) < 0) { |
2032 | /* XXX: we should have something like FWDHDRERROR here. */ | 2034 | /* XXX: we should have something like FWDHDRERROR here. */ |
@@ -2034,7 +2036,11 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) | |||
2034 | return 0; | 2036 | return 0; |
2035 | } | 2037 | } |
2036 | 2038 | ||
2037 | return xfrm_lookup(net, &skb->dst, &fl, NULL, 0) == 0; | 2039 | dst = skb_dst(skb); |
2040 | |||
2041 | res = xfrm_lookup(net, &dst, &fl, NULL, 0) == 0; | ||
2042 | skb_dst_set(skb, dst); | ||
2043 | return res; | ||
2038 | } | 2044 | } |
2039 | EXPORT_SYMBOL(__xfrm_route_forward); | 2045 | EXPORT_SYMBOL(__xfrm_route_forward); |
2040 | 2046 | ||