skbuff: add stub to help computing crc32c on SCTP packets

sctp_compute_checksum requires crc32c symbol (provided by libcrc32c), so
it can't be used in net core. Like it has been done previously with other
symbols (e.g. ipv6_dst_lookup), introduce a stub struct skb_checksum_ops
to allow computation of crc32c checksum in net core after sctp.ko (and thus
libcrc32c) has been loaded.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Davide Caratti 2017-05-18 15:44:37 +02:00 committed by David S. Miller
parent 6f5b24eed0
commit 9617813dba
3 changed files with 34 additions and 0 deletions

View file

@ -98,6 +98,11 @@ static const struct net_offload sctp6_offload = {
},
};
static const struct skb_checksum_ops crc32c_csum_ops = {
.update = sctp_csum_update,
.combine = sctp_csum_combine,
};
int __init sctp_offload_init(void)
{
int ret;
@ -110,6 +115,7 @@ int __init sctp_offload_init(void)
if (ret)
goto ipv4;
crc32c_csum_stub = &crc32c_csum_ops;
return ret;
ipv4: