aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2010-03-01 21:51:56 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 19:02:06 -0400
commit9f24b75bf551b5f343159da229ce734da380431b (patch)
treedb543299b6bcc0ed8a65ac66a90823bd9e2f8770 /net
parent03017375b0122453e6dda833ff7bd4191915def5 (diff)
ipsec: Fix bogus bundle flowi
[ Upstream commit 87c1e12b5eeb7b30b4b41291bef8e0b41fc3dde9 ] When I merged the bundle creation code, I introduced a bogus flowi value in the bundle. Instead of getting from the caller, it was instead set to the flow in the route object, which is totally different. The end result is that the bundles we created never match, and we instead end up with an ever growing bundle list. Thanks to Jamal for find this problem. Reported-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/xfrm4_policy.c5
-rw-r--r--net/ipv6/xfrm6_policy.c3
-rw-r--r--net/xfrm/xfrm_policy.c7
3 files changed, 9 insertions, 6 deletions
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 67107d63c1cd..e4a1483fba77 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -91,11 +91,12 @@ static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst,
91 return 0; 91 return 0;
92} 92}
93 93
94static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) 94static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
95 struct flowi *fl)
95{ 96{
96 struct rtable *rt = (struct rtable *)xdst->route; 97 struct rtable *rt = (struct rtable *)xdst->route;
97 98
98 xdst->u.rt.fl = rt->fl; 99 xdst->u.rt.fl = *fl;
99 100
100 xdst->u.dst.dev = dev; 101 xdst->u.dst.dev = dev;
101 dev_hold(dev); 102 dev_hold(dev);
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index dbdc696f5fc5..ae181651c75a 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -116,7 +116,8 @@ static int xfrm6_init_path(struct xfrm_dst *path, struct dst_entry *dst,
116 return 0; 116 return 0;
117} 117}
118 118
119static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) 119static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
120 struct flowi *fl)
120{ 121{
121 struct rt6_info *rt = (struct rt6_info*)xdst->route; 122 struct rt6_info *rt = (struct rt6_info*)xdst->route;
122 123
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 0ecb16a9a883..f12dd3d88520 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1354,7 +1354,8 @@ static inline int xfrm_init_path(struct xfrm_dst *path, struct dst_entry *dst,
1354 return err; 1354 return err;
1355} 1355}
1356 1356
1357static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) 1357static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
1358 struct flowi *fl)
1358{ 1359{
1359 struct xfrm_policy_afinfo *afinfo = 1360 struct xfrm_policy_afinfo *afinfo =
1360 xfrm_policy_get_afinfo(xdst->u.dst.ops->family); 1361 xfrm_policy_get_afinfo(xdst->u.dst.ops->family);
@@ -1363,7 +1364,7 @@ static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev)
1363 if (!afinfo) 1364 if (!afinfo)
1364 return -EINVAL; 1365 return -EINVAL;
1365 1366
1366 err = afinfo->fill_dst(xdst, dev); 1367 err = afinfo->fill_dst(xdst, dev, fl);
1367 1368
1368 xfrm_policy_put_afinfo(afinfo); 1369 xfrm_policy_put_afinfo(afinfo);
1369 1370
@@ -1468,7 +1469,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
1468 for (dst_prev = dst0; dst_prev != dst; dst_prev = dst_prev->child) { 1469 for (dst_prev = dst0; dst_prev != dst; dst_prev = dst_prev->child) {
1469 struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev; 1470 struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev;
1470 1471
1471 err = xfrm_fill_dst(xdst, dev); 1472 err = xfrm_fill_dst(xdst, dev, fl);
1472 if (err) 1473 if (err)
1473 goto free_dst; 1474 goto free_dst;
1474 1475