]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly
authorlucien <lucien.xin@gmail.com>
Mon, 17 Mar 2014 04:51:01 +0000 (12:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Mar 2014 19:17:53 +0000 (15:17 -0400)
commit09dd7c1952363eefc05a19f0f1720ccf816ca01a
treec2810ba4094340d30a3689e126caa433182d4948
parent9321aba7bcf2d1f29ad5c86c5d1798da928e0aac
ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly

In ip6_append_data_mtu(), when the xfrm mode is not tunnel(such as
transport),the ipsec header need to be added in the first fragment, so the mtu
will decrease to reserve space for it, then the second fragment come, the mtu
should be turn back, as the commit a9c6bf0a334a7a78a8fa607533dd881320ae9b39
said.  however, in the commit a493e60ac4bbe2e977e7129d6d8cbb0dd236be, it use
*mtu = min(*mtu, ...) to change the mtu, which lead to the new mtu is alway
equal with the first fragment's. and cannot turn back.

when I test through  ping6 -c1 -s5000 $ip (mtu=1280):
...frag (0|1232) ESP(spi=0x00002000,seq=0xb), length 1232
...frag (1232|1216)
...frag (2448|1216)
...frag (3664|1216)
...frag (4880|164)

which should be:
...frag (0|1232) ESP(spi=0x00001000,seq=0x1), length 1232
...frag (1232|1232)
...frag (2464|1232)
...frag (3696|1232)
...frag (4928|116)

so delete the min() when change back the mtu.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Fixes: 187f3e9b4a93a6 ("ipv6: ip6_append_data_mtu did not care about pmtudisc and frag_size")
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c