ctdb-common: Improve TCP packet size and offset calculations
authorMartin Schwenke <martin@meltin.net>
Fri, 17 Aug 2018 11:26:04 +0000 (21:26 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 30 Aug 2018 02:48:59 +0000 (04:48 +0200)
commit924a655b2a56edea66064dd1fdf67d9b7e093b64
tree2f12f53f9e072f6c1d48ba58c56bed6b8a47955f
parent43a2022596ed3bde1e2c833070b531a4b7289b84
ctdb-common: Improve TCP packet size and offset calculations

The IPv4 check for short packets was strange.  It appeared to ensure
that the capture included everything up to and including the window
size.  The checksum field immediately follows the window size field,
so just ensure that the packet is large enough to contain everything
up to the start of the checksum.

Add a similar check for IPv6 packets.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/system_socket.c