]> git.baikalelectronics.ru Git - kernel.git/commit
udp: fix IP_CHECKSUM handling
authorEric Dumazet <edumazet@google.com>
Mon, 24 Oct 2016 01:03:06 +0000 (18:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Oct 2016 21:33:22 +0000 (17:33 -0400)
commit9ad9ac9ff0278b78e38d5d526e3b29535f0c7e74
tree364d982c791875093f8b1cf2f6227c6e471dcf11
parent4464791409921d5dbc4c9de3d9d0d73dba5a0edc
udp: fix IP_CHECKSUM handling

First bug was added in commit f60d050c04fc ("ip: Add offset parameter to
ip_cmsg_recv") : Tom missed that ipv4 udp messages could be received on
AF_INET6 socket. ip_cmsg_recv(msg, skb) should have been replaced by
ip_cmsg_recv_offset(msg, skb, sizeof(struct udphdr));

Then commit 44fa15a2618b ("udp: remove headers from UDP packets before
queueing") forgot to adjust the offsets now UDP headers are pulled
before skb are put in receive queue.

Fixes: f60d050c04fc ("ip: Add offset parameter to ip_cmsg_recv")
Fixes: 44fa15a2618b ("udp: remove headers from UDP packets before queueing")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Sam Kumar <samanthakumar@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Tested-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip.h
net/ipv4/ip_sockglue.c
net/ipv4/udp.c
net/ipv6/udp.c