udp4: fix IP_CMSG_CHECKSUM for connected sockets
authorPaolo Abeni <pabeni@redhat.com>
Thu, 13 Sep 2018 14:27:20 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Sep 2018 22:27:44 +0000 (15:27 -0700)
commit2b5a921740a55c00223a797d075b9c77c42cb171
tree384b3c86784345a2f25cce36d43ff4a3ea9e729b
parentedf2ef7242805e53ec2e0841db26e06d8bc7da70
udp4: fix IP_CMSG_CHECKSUM for connected sockets

commit 2abb7cdc0dc8 ("udp: Add support for doing checksum
unnecessary conversion") left out the early demux path for
connected sockets. As a result IP_CMSG_CHECKSUM gives wrong
values for such socket when GRO is not enabled/available.

This change addresses the issue by moving the csum conversion to a
common helper and using such helper in both the default and the
early demux rx path.

Fixes: 2abb7cdc0dc8 ("udp: Add support for doing checksum unnecessary conversion")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c