Skip to content

ip: Support checksum returned in csmg

Tom Herbert netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 of 4 patches 1 replyIn review
  2. v13 of 4 patches 2 repliesSuperseded

3 of 4 patches are in this archive. The cover letter announces 4.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ip: Move checksum convert defines to inetinclude/linux/udp.h include/net/inet_sock.h net/ipv4/fou.c +3 more+22 -190 replies
3/4ip: Add offset parameter to ip_cmsg_recvinclude/net/ip.h net/ipv4/ip_sockglue.c+9 -30 replies
4/4ip: Add offset parameter to ip_cmsg_recvinclude/net/inet_sock.h include/uapi/linux/in.h net/ipv4/ip_sockglue.c +1 more+43 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH net-next v3 0/4] ip: Support checksum returned in csmg

This patch set allows the packet checksum for a datagram socket to be returned in csum data in recvmsg. This allows userspace to implement its own checksum over the data, for instance if an IP tunnel was be implemented in user space, the inner checksum could be validated.

Changes in this patch set:
- Move checksum conversion to inet_sock from udp_sock. This generalizes checksum conversion for use with other protocols.
- Move IP cmsg constants to a header file and make processing of the flags more efficient in ip_cmsg_recv
- Return checksum value in cmsg. This is specifically the unfolded 32 bit checksum of the full packet starting from the first byte returned in recvmsg

Tested: Wrote a little server to get checksums in cmsg for UDP and
verfied correct checksum is returned.

Tom Herbert (4):
ip: Move checksum convert defines to inet
ip: IP cmsg cleanup
ip: Add offset parameter to ip_cmsg_recv
ip: Add offset parameter to ip_cmsg_recv

 include/linux/udp.h     |  16 +------
 include/net/inet_sock.h |  29 ++++++++++++-
 include/net/ip.h        |   7 +++-
 include/uapi/linux/in.h |   1 +
 net/ipv4/fou.c          |   2 +-
 net/ipv4/ip_sockglue.c  | 108 +++++++++++++++++++++++++++++++++++-------------
 net/ipv4/udp.c          |   4 +-
 net/ipv4/udp_tunnel.c   |   2 +-
 net/ipv6/udp.c          |   2 +-
 9 files changed, 120 insertions(+), 51 deletions(-)
Signature · 1 line
2.2.0.rc0.207.ga3a616c