aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMasahide NAKAMURA <nakam@linux-ipv6.org>2007-02-10 00:22:16 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:20:47 -0500
commitbda390d5c883d5dff1f3ae2bade4c25869769894 (patch)
treefeb2196ff29a5d78098047c546b2c0162b5cb659 /net
parent1e19e02ca0c5e33ea73a25127dbe6c3b8fcaac4b (diff)
[XFRM] IPV6: Fix outbound RO transformation which is broken by IPsec tunnel patch.
It seems to miss RO mode path by IPv6 over IPv4 IPsec tunnel patch when it changed semantics to check the mode from "xfrm[i]->props.mode != XFRM_MODE_TRANSPORT" to "xfrm[i]->props.mode == XFRM_MODE_TUNNEL" before changing address. It also makes two incline functions __xfrm6_bundle_addr_{remote,local} are used by nobody. This patch fixes it. Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/xfrm6_policy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 55f650c49678..b1133f27c8ae 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -178,7 +178,8 @@ __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_TUNNEL ||
182 xfrm[i]->props.mode == XFRM_MODE_ROUTEOPTIMIZATION) {
182 unsigned short encap_family = xfrm[i]->props.family; 183 unsigned short encap_family = xfrm[i]->props.family;
183 switch(encap_family) { 184 switch(encap_family) {
184 case AF_INET: 185 case AF_INET:
@@ -186,8 +187,9 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
186 fl_tunnel.fl4_src = xfrm[i]->props.saddr.a4; 187 fl_tunnel.fl4_src = xfrm[i]->props.saddr.a4;
187 break; 188 break;
188 case AF_INET6: 189 case AF_INET6:
189 ipv6_addr_copy(&fl_tunnel.fl6_dst, (struct in6_addr*)&xfrm[i]->id.daddr.a6); 190 ipv6_addr_copy(&fl_tunnel.fl6_dst, __xfrm6_bundle_addr_remote(xfrm[i], &fl->fl6_dst));
190 ipv6_addr_copy(&fl_tunnel.fl6_src, (struct in6_addr*)&xfrm[i]->props.saddr.a6); 191
192 ipv6_addr_copy(&fl_tunnel.fl6_src, __xfrm6_bundle_addr_remote(xfrm[i], &fl->fl6_src));
191 break; 193 break;
192 default: 194 default:
193 BUG_ON(1); 195 BUG_ON(1);