traffic: improve is_really_a_packet
authorJoe Guo <joeg@catalyst.net.nz>
Thu, 10 May 2018 05:11:29 +0000 (17:11 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 00:09:29 +0000 (02:09 +0200)
commit38fc8125e2728926da31555386b93a0d5acb1c0e
treec2bc8553a0c6831234ee847abe7217ffb8dcb854
parentc1af6a0dada79888d3eb9c820163a6b34e900638
traffic: improve is_really_a_packet

This function will repeat on each packet.
Avoid exception for getattr, which is expensive for performance.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/emulate/traffic.py