diff options
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 15aa4c58c315..82e27b80d07d 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -178,8 +178,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int | |||
178 | __xfrm6_bundle_len_inc(&header_len, &nfheader_len, xfrm[i]); | 178 | __xfrm6_bundle_len_inc(&header_len, &nfheader_len, xfrm[i]); |
179 | trailer_len += xfrm[i]->props.trailer_len; | 179 | trailer_len += xfrm[i]->props.trailer_len; |
180 | 180 | ||
181 | if (xfrm[i]->props.mode == XFRM_MODE_TUNNEL || | 181 | if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) { |
182 | xfrm[i]->props.mode == XFRM_MODE_ROUTEOPTIMIZATION) { | ||
183 | unsigned short encap_family = xfrm[i]->props.family; | 182 | unsigned short encap_family = xfrm[i]->props.family; |
184 | switch(encap_family) { | 183 | switch(encap_family) { |
185 | case AF_INET: | 184 | case AF_INET: |
@@ -215,7 +214,6 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int | |||
215 | i = 0; | 214 | i = 0; |
216 | for (; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) { | 215 | for (; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) { |
217 | struct xfrm_dst *x = (struct xfrm_dst*)dst_prev; | 216 | struct xfrm_dst *x = (struct xfrm_dst*)dst_prev; |
218 | struct xfrm_state_afinfo *afinfo; | ||
219 | 217 | ||
220 | dst_prev->xfrm = xfrm[i++]; | 218 | dst_prev->xfrm = xfrm[i++]; |
221 | dst_prev->dev = rt->u.dst.dev; | 219 | dst_prev->dev = rt->u.dst.dev; |
@@ -232,18 +230,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int | |||
232 | /* Copy neighbour for reachability confirmation */ | 230 | /* Copy neighbour for reachability confirmation */ |
233 | dst_prev->neighbour = neigh_clone(rt->u.dst.neighbour); | 231 | dst_prev->neighbour = neigh_clone(rt->u.dst.neighbour); |
234 | dst_prev->input = rt->u.dst.input; | 232 | dst_prev->input = rt->u.dst.input; |
235 | /* XXX: When IPv4 is implemented as module and can be unloaded, | 233 | dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output; |
236 | * we should manage reference to xfrm4_output in afinfo->output. | ||
237 | * Miyazawa | ||
238 | */ | ||
239 | afinfo = xfrm_state_get_afinfo(dst_prev->xfrm->props.family); | ||
240 | if (!afinfo) { | ||
241 | dst = *dst_p; | ||
242 | goto error; | ||
243 | } | ||
244 | |||
245 | dst_prev->output = afinfo->output; | ||
246 | xfrm_state_put_afinfo(afinfo); | ||
247 | /* Sheit... I remember I did this right. Apparently, | 234 | /* Sheit... I remember I did this right. Apparently, |
248 | * it was magically lost, so this code needs audit */ | 235 | * it was magically lost, so this code needs audit */ |
249 | x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); | 236 | x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); |