diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-11 14:26:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-11 14:26:58 -0400 |
commit | 3c709f8fb43e07a0403bba4a8ca7ba00ab874994 (patch) | |
tree | 9efc1e2bf6930851f0224f525b6cde0f5297fa61 /net/xfrm/xfrm_policy.c | |
parent | 0074820978004cc484b132d7a9ce0df414660d9d (diff) | |
parent | 9bbc052d5e63512b0ce4e201ea97e12fba9fda82 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-3.6
Conflicts:
drivers/net/benet/be_main.c
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 00bcb88386c2..9bec2e8a838c 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1407,6 +1407,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy, | |||
1407 | struct net *net = xp_net(policy); | 1407 | struct net *net = xp_net(policy); |
1408 | unsigned long now = jiffies; | 1408 | unsigned long now = jiffies; |
1409 | struct net_device *dev; | 1409 | struct net_device *dev; |
1410 | struct xfrm_mode *inner_mode; | ||
1410 | struct dst_entry *dst_prev = NULL; | 1411 | struct dst_entry *dst_prev = NULL; |
1411 | struct dst_entry *dst0 = NULL; | 1412 | struct dst_entry *dst0 = NULL; |
1412 | int i = 0; | 1413 | int i = 0; |
@@ -1437,6 +1438,17 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy, | |||
1437 | goto put_states; | 1438 | goto put_states; |
1438 | } | 1439 | } |
1439 | 1440 | ||
1441 | if (xfrm[i]->sel.family == AF_UNSPEC) { | ||
1442 | inner_mode = xfrm_ip2inner_mode(xfrm[i], | ||
1443 | xfrm_af2proto(family)); | ||
1444 | if (!inner_mode) { | ||
1445 | err = -EAFNOSUPPORT; | ||
1446 | dst_release(dst); | ||
1447 | goto put_states; | ||
1448 | } | ||
1449 | } else | ||
1450 | inner_mode = xfrm[i]->inner_mode; | ||
1451 | |||
1440 | if (!dst_prev) | 1452 | if (!dst_prev) |
1441 | dst0 = dst1; | 1453 | dst0 = dst1; |
1442 | else { | 1454 | else { |
@@ -1465,7 +1477,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy, | |||
1465 | dst1->lastuse = now; | 1477 | dst1->lastuse = now; |
1466 | 1478 | ||
1467 | dst1->input = dst_discard; | 1479 | dst1->input = dst_discard; |
1468 | dst1->output = xfrm[i]->outer_mode->afinfo->output; | 1480 | dst1->output = inner_mode->afinfo->output; |
1469 | 1481 | ||
1470 | dst1->next = dst_prev; | 1482 | dst1->next = dst_prev; |
1471 | dst_prev = dst1; | 1483 | dst_prev = dst1; |