1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

traffic: Conversation.add_short_packet is discerning about packets

If the packets really wouldn't do anything, we might as well not add them.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2018-10-19 17:24:53 +13:00 committed by Douglas Bagnall
parent db51004307
commit b5d493f927

View File

@ -860,11 +860,14 @@ class Conversation(object):
self.packets.append(p)
def add_short_packet(self, timestamp, protocol, opcode, extra,
client=True):
client=True, skip_unused_packets=True):
"""Create a packet from a timestamp, and 'protocol:opcode' pair, and a
(possibly empty) list of extra data. If client is True, assume
this packet is from the client to the server.
"""
if skip_unused_packets and not is_a_real_packet(protocol, opcode):
return
src, dest = self.guess_client_server()
if not client:
src, dest = dest, src