diff options
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 044e77898512..8b3ef404c794 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1433,7 +1433,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy, | |||
1433 | } | 1433 | } |
1434 | 1434 | ||
1435 | xdst->route = dst; | 1435 | xdst->route = dst; |
1436 | memcpy(&dst1->metrics, &dst->metrics, sizeof(dst->metrics)); | 1436 | dst_copy_metrics(dst1, dst); |
1437 | 1437 | ||
1438 | if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) { | 1438 | if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) { |
1439 | family = xfrm[i]->props.family; | 1439 | family = xfrm[i]->props.family; |
@@ -2271,7 +2271,7 @@ static void xfrm_init_pmtu(struct dst_entry *dst) | |||
2271 | if (pmtu > route_mtu_cached) | 2271 | if (pmtu > route_mtu_cached) |
2272 | pmtu = route_mtu_cached; | 2272 | pmtu = route_mtu_cached; |
2273 | 2273 | ||
2274 | dst->metrics[RTAX_MTU-1] = pmtu; | 2274 | dst_metric_set(dst, RTAX_MTU, pmtu); |
2275 | } while ((dst = dst->next)); | 2275 | } while ((dst = dst->next)); |
2276 | } | 2276 | } |
2277 | 2277 | ||
@@ -2349,7 +2349,7 @@ static int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first, | |||
2349 | mtu = xfrm_state_mtu(dst->xfrm, mtu); | 2349 | mtu = xfrm_state_mtu(dst->xfrm, mtu); |
2350 | if (mtu > last->route_mtu_cached) | 2350 | if (mtu > last->route_mtu_cached) |
2351 | mtu = last->route_mtu_cached; | 2351 | mtu = last->route_mtu_cached; |
2352 | dst->metrics[RTAX_MTU-1] = mtu; | 2352 | dst_metric_set(dst, RTAX_MTU, mtu); |
2353 | 2353 | ||
2354 | if (last == first) | 2354 | if (last == first) |
2355 | break; | 2355 | break; |
@@ -2361,6 +2361,16 @@ static int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first, | |||
2361 | return 1; | 2361 | return 1; |
2362 | } | 2362 | } |
2363 | 2363 | ||
2364 | static unsigned int xfrm_default_advmss(const struct dst_entry *dst) | ||
2365 | { | ||
2366 | return dst_metric_advmss(dst->path); | ||
2367 | } | ||
2368 | |||
2369 | static unsigned int xfrm_default_mtu(const struct dst_entry *dst) | ||
2370 | { | ||
2371 | return dst_mtu(dst->path); | ||
2372 | } | ||
2373 | |||
2364 | int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | 2374 | int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) |
2365 | { | 2375 | { |
2366 | struct net *net; | 2376 | struct net *net; |
@@ -2378,6 +2388,10 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
2378 | dst_ops->kmem_cachep = xfrm_dst_cache; | 2388 | dst_ops->kmem_cachep = xfrm_dst_cache; |
2379 | if (likely(dst_ops->check == NULL)) | 2389 | if (likely(dst_ops->check == NULL)) |
2380 | dst_ops->check = xfrm_dst_check; | 2390 | dst_ops->check = xfrm_dst_check; |
2391 | if (likely(dst_ops->default_advmss == NULL)) | ||
2392 | dst_ops->default_advmss = xfrm_default_advmss; | ||
2393 | if (likely(dst_ops->default_mtu == NULL)) | ||
2394 | dst_ops->default_mtu = xfrm_default_mtu; | ||
2381 | if (likely(dst_ops->negative_advice == NULL)) | 2395 | if (likely(dst_ops->negative_advice == NULL)) |
2382 | dst_ops->negative_advice = xfrm_negative_advice; | 2396 | dst_ops->negative_advice = xfrm_negative_advice; |
2383 | if (likely(dst_ops->link_failure == NULL)) | 2397 | if (likely(dst_ops->link_failure == NULL)) |