Skip to content

By-default, don't create an iptables rule to checksum SCTP#48149

Merged
cpuguy83 merged 1 commit intomoby:masterfrom
robmry:47952_remove_sctp_checksum_iptables_rule
Jul 10, 2024
Merged

By-default, don't create an iptables rule to checksum SCTP#48149
cpuguy83 merged 1 commit intomoby:masterfrom
robmry:47952_remove_sctp_checksum_iptables_rule

Conversation

@robmry
Copy link
Contributor

@robmry robmry commented Jul 10, 2024

- What I did

For SCTP port mappings, an iptables mangle rule was create to fix the checksum. The code comment says it was done to fix a problem caused by the veth driver reporting NETIF_F_SCTP_CRC since kernel 4.9, when used with NICs that do not support NETIF_F_SCTP_CRC.

But the checksum rule fills in the checksum in the IP header, not an SCTP checksum, so it doesn't seem related. And, quoting from the github issue, "since kernel v4.19, the xt_CHECKSUM.c explicitly states it should only be used for UDP and only in the OUTPUT chain - while docker is using it for SCTP in the PREROUTING chain".

Furthermore, the rule is reported to be causing errors for SCTP between containers.

- How I did it

Because we don't entirely understand why the rule exists, it is now only added if the daemon's env has
DOCKER_IPTABLES_SCTP_CHECKSUM=1. If no problems are reported, that escape-hatch and the code to add the rule will be removed in a future release.

- How to verify it

Use iptables -nvL -t mangle to check that the rule is only created when the env-var DOCKER_IPTABLES_SCTP_CHECKSUM=1.

- Description for the changelog

Removed an `iptables` mangle rule for checksumming SCTP. The rule can be re-enabled by setting
`DOCKER_IPTABLES_SCTP_CHECKSUM=1` in the daemon's environment. This override will be
removed in a future release.

For SCTP port mappings, an iptables mangle rule was create to fix
the checksum. The code comment says it was done to fix a problem
caused by the veth driver reporting NETIF_F_SCTP_CRC since kernel
4.9, when used with NICs that do not support NETIF_F_SCTP_CRC.

But the checksum rule fills in the checksum in the IP header,
not an SCTP checksum, so it doesn't seem related. And, quoting
from the github issue, "since kernel v4.19, the xt_CHECKSUM.c
explicitly states it should only be used for UDP and only in the
OUTPUT chain - while docker is using it for SCTP in the PREROUTING
chain".

Furthermore, the rule is reported to be causing errors for SCTP
between containers.

Because we don't entirely understand why the rule exists, it
is now only added if the daemon's env has
DOCKER_IPTABLES_SCTP_CHECKSUM=1. If no problems are reported, that
escape-hatch and the code to add the rule will be removed in a
future release.

Signed-off-by: Rob Murray <rob.murray@docker.com>
@robmry robmry added this to the 28.0.0 milestone Jul 10, 2024
@robmry robmry requested review from akerouanton and corhere July 10, 2024 18:10
@robmry robmry self-assigned this Jul 10, 2024
@vvoland
Copy link
Contributor

vvoland commented Aug 16, 2024

Removing 27.2 cherry-pick label as technically it's a breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove iptables rule for SCTP checksum fixup

4 participants