]> git.baikalelectronics.ru Git - kernel.git/commit
udp: do not expect udp headers in recv cmsg IP_CMSG_CHECKSUM
authorWillem de Bruijn <willemb@google.com>
Thu, 7 Apr 2016 22:12:59 +0000 (18:12 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Apr 2016 02:24:52 +0000 (22:24 -0400)
commit25a5b3f00a9b4883f553d4033072cc9a7355e570
tree0c1883a4c4c478746162c66befa7d5d0f8e79dc8
parent72ea15b85ac28d64444dfdf703b6cedd5aabe2c2
udp: do not expect udp headers in recv cmsg IP_CMSG_CHECKSUM

On udp sockets, recv cmsg IP_CMSG_CHECKSUM returns a checksum over
the packet payload. Since commit 44fa15a2618b pulled the headers,
taking skb->data as the start of transport header is incorrect. Use
the transport header pointer.

Also, when peeking at an offset from the start of the packet, only
return a checksum from the start of the peeked data. Note that the
cmsg does not subtract a tail checkum when reading truncated data.

Fixes: 44fa15a2618b ("udp: remove headers from UDP packets before queueing")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_sockglue.c
net/ipv4/udp.c