mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
tests: Optimize tshark operations for new versions
The wlan_mgt to wlan renaming is already included in most recent tshark versions, so replace the backwards compatibility option to prefer the new version so that current versions do not need to take the performance hit. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
a48a60ea47
commit
985718135f
@ -88,7 +88,9 @@ def _run_tshark(filename, filter, display=None, wait=True):
|
||||
def run_tshark(filename, filter, display=None, wait=True):
|
||||
if display is None: display = []
|
||||
try:
|
||||
return _run_tshark(filename, filter, display, wait)
|
||||
return _run_tshark(filename, filter.replace('wlan_mgt', 'wlan'),
|
||||
[x.replace('wlan_mgt', 'wlan') for x in display],
|
||||
wait)
|
||||
except UnknownFieldsException as e:
|
||||
all_wlan_mgt = True
|
||||
for f in e.fields:
|
||||
@ -97,9 +99,7 @@ def run_tshark(filename, filter, display=None, wait=True):
|
||||
break
|
||||
if not all_wlan_mgt:
|
||||
raise
|
||||
return _run_tshark(filename, filter.replace('wlan_mgt', 'wlan'),
|
||||
[x.replace('wlan_mgt', 'wlan') for x in display],
|
||||
wait)
|
||||
return _run_tshark(filename, filter, display, wait)
|
||||
|
||||
def run_tshark_json(filename, filter):
|
||||
arg = ["tshark", "-r", filename,
|
||||
|
Loading…
Reference in New Issue
Block a user