]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: Fix udp checksums with raw sockets
authorVlad Yasevich <vyasevich@gmail.com>
Fri, 15 May 2015 00:34:08 +0000 (20:34 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 May 2015 02:27:03 +0000 (22:27 -0400)
commita3c82359be5690bd767fbd189d2c0dc7afd1c645
tree5ca5fa212bb94d7ec193e8903233967a4f4f9bae
parentd61df803ccda84ae442a9b828c555dd1f65972ab
ipv6: Fix udp checksums with raw sockets

It was reported that trancerout6 would cause
a kernel to crash when trying to compute checksums
on raw UDP packets.  The cause was the check in
__ip6_append_data that would attempt to use
partial checksums on the packet.  However,
raw sockets do not initialize partial checksum
fields so partial checksums can't be used.

Solve this the same way IPv4 does it.  raw sockets
pass transhdrlen value of 0 to ip_append_data which
causes the checksum to be computed in software.  Use
the same check in ip6_append_data (check transhdrlen).

Reported-by: Wolfgang Walter <linux@stwm.de>
CC: Wolfgang Walter <linux@stwm.de>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c