]> Pileus Git - ~andy/linux/commit
ipvs: sctp: fix checksumming on snat and dnat handlers
authorDaniel Borkmann <dborkman@redhat.com>
Tue, 5 Feb 2013 16:21:31 +0000 (17:21 +0100)
committerSimon Horman <horms@verge.net.au>
Wed, 6 Feb 2013 00:56:50 +0000 (09:56 +0900)
commit4b47bc9a9e69141ed3a854c57601f548e82c78ba
tree3ba347682e08ac95194e7ec323157f6f164c630a
parentb425df4cdd953a400d814b4474c9d3ec04481858
ipvs: sctp: fix checksumming on snat and dnat handlers

In our test lab, we have a simple SCTP client connecting to a SCTP
server via an IPVS load balancer. On some machines, load balancing
works, but on others the initial handshake just fails, thus no
SCTP connection whatsoever can be established!

We observed that the SCTP INIT-ACK handshake reply from the IPVS
machine to the client had a correct IP checksum, but corrupt SCTP
checksum when forwarded, thus on the client-side the packet was
dropped and an intial handshake retriggered until all attempts
run into the void.

To fix this issue, this patch i) adds a missing CHECKSUM_UNNECESSARY
after the full checksum (re-)calculation (as done in IPVS TCP and UDP
code as well), ii) calculates the checksum in little-endian format
(as fixed with the SCTP code in commit 4458f04c: sctp: Clean up sctp
checksumming code) and iii) refactors duplicate checksum code into a
common function. Tested by myself.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
net/netfilter/ipvs/ip_vs_proto_sctp.c