History

netfilter: nftables: allow re-computing sctp CRC-32C in 'payload' statements

nftables payload statements are used to mangle SCTP headers, but they can only replace the Internet Checksum. As a consequence, nftables rules that mangle sport/dport/vtag in SCTP headers potentially generate packets that are discarded by the receiver, unless the CRC-32C is "offloaded" (e.g the rule mangles a skb having 'ip_summed' equal to 'CHECKSUM_PARTIAL'. Fix this extending uAPI definitions and L4 checksum update function, in a way that userspace programs (e.g. nft) can instruct the kernel to compute CRC-32C in SCTP headers. Also ensure that LIBCRC32C is built if NF_TABLES is 'y' or 'm' in the kernel build configuration.

Davide Caratti committed 6 years ago

Commit 346e3201 parent 54086c53 files · +31 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+2−0
@@ -749,10 +749,12 @@ enum nft_payload_bases { · 748 unmodified lines
749749 *
750750 * @NFT_PAYLOAD_CSUM_NONE: no checksumming
751751 * @NFT_PAYLOAD_CSUM_INET: internet checksum (RFC 791)
752+ * @NFT_PAYLOAD_CSUM_SCTP: CRC-32c, for use in SCTP header (RFC 3309)
752753 */
753754 enum nft_payload_csum_types {
754755 NFT_PAYLOAD_CSUM_NONE,
755756 NFT_PAYLOAD_CSUM_INET,
757+ NFT_PAYLOAD_CSUM_SCTP,
756758 };
757759
758760 enum nft_payload_csum_flags {