]> git.baikalelectronics.ru Git - kernel.git/commit
net: skb_checksum: allow custom update/combine for walking skb
authorDaniel Borkmann <dborkman@redhat.com>
Wed, 30 Oct 2013 10:50:51 +0000 (11:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Nov 2013 04:04:57 +0000 (23:04 -0500)
commitc38be5cb7db63aac26793f09fb057d64bb719ac1
tree71aac3aa2a48588fd0b5372cca9499bd1cbe2a5f
parent1ea21c439605124fe77f16654e884c52fd835cb8
net: skb_checksum: allow custom update/combine for walking skb

Currently, skb_checksum walks over 1) linearized, 2) frags[], and
3) frag_list data and calculats the one's complement, a 32 bit
result suitable for feeding into itself or csum_tcpudp_magic(),
but unsuitable for SCTP as we're calculating CRC32c there.

Hence, in order to not re-implement the very same function in
SCTP (and maybe other protocols) over and over again, use an
update() + combine() callback internally to allow for walking
over the skb with different algorithms.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
include/net/checksum.h
net/core/skbuff.c