aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2012-05-26 01:30:53 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-10 00:33:02 +0900
commit5111df358197ca9c5001bf2bb542fc8c346bb5b5 (patch)
treed471e9b4242fd4fc39c91805e004980df9719821 /net/xfrm/xfrm_policy.c
parent49d7872377ba34fc2b2e1e460073a387e7adcfae (diff)
downloadkernel_samsung_tuna-5111df358197ca9c5001bf2bb542fc8c346bb5b5.zip
kernel_samsung_tuna-5111df358197ca9c5001bf2bb542fc8c346bb5b5.tar.gz
kernel_samsung_tuna-5111df358197ca9c5001bf2bb542fc8c346bb5b5.tar.bz2
ipv6: fix incorrect ipsec fragment
[ Upstream commit 0c1833797a5a6ec23ea9261d979aa18078720b74 ] Since commit ad0081e43a "ipv6: Fragment locally generated tunnel-mode IPSec6 packets as needed" the fragment of packets is incorrect. because tunnel mode needs IPsec headers and trailer for all fragments, while on transport mode it is sufficient to add the headers to the first fragment and the trailer to the last. so modify mtu and maxfraglen base on ipsec mode and if fragment is first or last. with my test,it work well(every fragment's size is the mtu) and does not trigger slow fragment path. Changes from v1: though optimization, mtu_prev and maxfraglen_prev can be delete. replace xfrm mode codes with dst_entry's new frag DST_XFRM_TUNNEL. add fuction ip6_append_data_mtu to make codes clearer. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 7803eb6..0c0e40e 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1917,6 +1917,9 @@ no_transform:
}
ok:
xfrm_pols_put(pols, drop_pols);
+ if (dst && dst->xfrm &&
+ dst->xfrm->props.mode == XFRM_MODE_TUNNEL)
+ dst->flags |= DST_XFRM_TUNNEL;
return dst;
nopol: