提交 bf250a1f 编写于 作者: V Vlad Yasevich 提交者: David S. Miller

ipv6: Partial checksum only UDP packets

ip6_append_data is used by other protocols and some of them can't
be partially checksummed.  Only partially checksum UDP protocol.

Fixes: 32dce968 (ipv6: Allow for partial checksums on non-ufo packets)
Reported-by: NSabrina Dubroca <sd@queasysnail.net>
Tested-by: NSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: NVladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4a3046d6
......@@ -1273,7 +1273,7 @@ static int __ip6_append_data(struct sock *sk,
/* If this is the first and only packet and device
* supports checksum offloading, let's use it.
*/
if (!skb &&
if (!skb && sk->sk_protocol == IPPROTO_UDP &&
length + fragheaderlen < mtu &&
rt->dst.dev->features & NETIF_F_V6_CSUM &&
!exthdrlen)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册