]> 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)
commit2eb157c41344a381222a93e1e5c237186ce04a5f
tree71aac3aa2a48588fd0b5372cca9499bd1cbe2a5f
parent09bb45e1181e9bf46a4aecab5ed915e46d4a054a
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