ctdb-common: Avoid aliasing errors during code optimization
commit7e955ca5cf91a3cfdc53132c362de0b6c4ffa64b
authorAmitay Isaacs <amitay@gmail.com>
Mon, 27 Jul 2020 02:51:41 +0000 (27 12:51 +1000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 30 Oct 2020 15:24:11 +0000 (30 15:24 +0000)
tree8feb9f032899c105b5b906dd9367f481fc248061
parente1f7e422bd560196f735c96e6bf6d84524d169a7
ctdb-common: Avoid aliasing errors during code optimization

When compiling with GCC 10.x and -O3 optimization, the IP checksum
calculation code generates wrong checksum.  The function uint16_checksum
gets inlined during optimization and ip4pkt->tcp data gets wrongly
aliased.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14537

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Oct 21 05:52:28 UTC 2020 on sn-devel-184

(cherry picked from commit 6aa396b0cd1f83f45cb76a4f3123d99135e8dd8c)

Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-12-test): Fri Oct 30 15:24:11 UTC 2020 on sn-devel-184
ctdb/common/system_socket.c