[UDP]: Clean up UDP-Lite receive checksum
This patch eliminates some duplicate code for the verification of receive checksums between UDP-Lite and UDP. It does this by introducing __skb_checksum_complete_head which is identical to __skb_checksum_complete_head apart from the fact that it takes a length parameter rather than computing the first skb->len bytes. As a result UDP-Lite will be able to use hardware checksum offload for packets which do not use partial coverage checksums. It also means that UDP-Lite loopback no longer does unnecessary checksum verification. If any NICs start support UDP-Lite this would also start working automatically. This patch removes the assumption that msg_flags has MSG_TRUNC clear upon entry in recvmsg. Signed-off-by:Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/linux/skbuff.h 1 addition, 0 deletionsinclude/linux/skbuff.h
- include/net/udp.h 1 addition, 4 deletionsinclude/net/udp.h
- include/net/udplite.h 6 additions, 33 deletionsinclude/net/udplite.h
- net/core/datagram.c 8 additions, 2 deletionsnet/core/datagram.c
- net/ipv4/udp.c 49 additions, 47 deletionsnet/ipv4/udp.c
- net/ipv4/udplite.c 1 addition, 1 deletionnet/ipv4/udplite.c
- net/ipv6/udp.c 42 additions, 32 deletionsnet/ipv6/udp.c
- net/ipv6/udplite.c 1 addition, 1 deletionnet/ipv6/udplite.c
Loading
Please register or sign in to comment