aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-11 14:26:15 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-11 14:26:58 -0400
commit3c709f8fb43e07a0403bba4a8ca7ba00ab874994 (patch)
tree9efc1e2bf6930851f0224f525b6cde0f5297fa61 /net/xfrm
parent0074820978004cc484b132d7a9ce0df414660d9d (diff)
parent9bbc052d5e63512b0ce4e201ea97e12fba9fda82 (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')
-rw-r--r--net/xfrm/xfrm_policy.c14
-rw-r--r--net/xfrm/xfrm_replay.c3
2 files changed, 16 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;
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index e8a781422feb..47f1b8638df9 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -535,6 +535,9 @@ int xfrm_init_replay(struct xfrm_state *x)
535 replay_esn->bmp_len * sizeof(__u32) * 8) 535 replay_esn->bmp_len * sizeof(__u32) * 8)
536 return -EINVAL; 536 return -EINVAL;
537 537
538 if ((x->props.flags & XFRM_STATE_ESN) && replay_esn->replay_window == 0)
539 return -EINVAL;
540
538 if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn) 541 if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn)
539 x->repl = &xfrm_replay_esn; 542 x->repl = &xfrm_replay_esn;
540 else 543 else