Skip to content

Commit

Permalink
ipv6: Partial checksum only UDP packets
Browse files Browse the repository at this point in the history
ip6_append_data is used by other protocols and some of them can't
be partially checksummed.  Only partially checksum UDP protocol.

Fixes: 32dce96 (ipv6: Allow for partial checksums on non-ufo packets)
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Tested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
vyasevich authored and davem330 committed Feb 11, 2015
1 parent 4a3046d commit bf250a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bf250a1

Please sign in to comment.