mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb-common: Fix a bug in non-Linux (PCAP) TCP packet capturing
Captured packets include a link-layer header, which is considered in the Linux code but not the PCAP code. Also, the actual captured length is in caplen, not len. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
0beb16f34e
commit
f3a1f1e1fa
@ -962,7 +962,7 @@ int ctdb_sys_read_tcp_packet(int s,
|
||||
|
||||
/* make sure its not a short packet */
|
||||
if (offsetof(struct tcphdr, th_ack) + 4 +
|
||||
(ip->ip_hl*4) > pkthdr.len) {
|
||||
(ip->ip_hl*4) + sizeof(*eth) > pkthdr.caplen) {
|
||||
return -1;
|
||||
}
|
||||
/* TCP */
|
||||
|
Loading…
Reference in New Issue
Block a user