From baefdf7b1e3f34fe470faec301d0cadc3e8b6b2c Mon Sep 17 00:00:00 2001 From: Jianwei Mao Date: Thu, 19 Sep 2019 00:33:55 +0800 Subject: [PATCH 1/4] fix bug for issue #1862 Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: https://github.com/secdev/scapy/issues/1862#issuecomment-532684551 --- scapy/arch/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scapy/arch/common.py b/scapy/arch/common.py index cf92cd9efa1..36a79eb9edc 100644 --- a/scapy/arch/common.py +++ b/scapy/arch/common.py @@ -42,7 +42,7 @@ def _check_tcpdump(): return False # On some systems, --version does not exist on tcpdump - return proc.returncode == 0 or output.startswith(b'Usage: tcpdump ') + return proc.returncode == 0 or output.startswith(b'Usage: tcpdump ') or output.startswith(b'tcpdump: unrecognized option') # This won't be used on Windows From 9fdd12df5d5048acd65e86997cfd533a1c006ed6 Mon Sep 17 00:00:00 2001 From: Jianwei Mao Date: Thu, 19 Sep 2019 23:39:35 +0800 Subject: [PATCH 2/4] fix bug for issue #1862 Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: https://github.com/secdev/scapy/issues/1862 --- scapy/arch/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scapy/arch/common.py b/scapy/arch/common.py index 36a79eb9edc..91d548dd093 100644 --- a/scapy/arch/common.py +++ b/scapy/arch/common.py @@ -42,7 +42,8 @@ def _check_tcpdump(): return False # On some systems, --version does not exist on tcpdump - return proc.returncode == 0 or output.startswith(b'Usage: tcpdump ') or output.startswith(b'tcpdump: unrecognized option') + return proc.returncode == 0 or output.startswith(b'Usage: tcpdump ') \ + or output.startswith(b'tcpdump: unrecognized option') # This won't be used on Windows From b8604b195edf130ff147e716f2e7f5f5b9a8665b Mon Sep 17 00:00:00 2001 From: Jianwei Mao Date: Thu, 19 Sep 2019 23:41:50 +0800 Subject: [PATCH 3/4] fix bug for issue #1862 Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: https://github.com/secdev/scapy/issues/1862 --- scapy/arch/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scapy/arch/common.py b/scapy/arch/common.py index 91d548dd093..d84e9dfa74c 100644 --- a/scapy/arch/common.py +++ b/scapy/arch/common.py @@ -42,7 +42,8 @@ def _check_tcpdump(): return False # On some systems, --version does not exist on tcpdump - return proc.returncode == 0 or output.startswith(b'Usage: tcpdump ') \ + return proc.returncode == 0 \ + or output.startswith(b'Usage: tcpdump ') \ or output.startswith(b'tcpdump: unrecognized option') From 0086afdeae36f4e55d27b44c9ca2527b291d1875 Mon Sep 17 00:00:00 2001 From: Jianwei Mao Date: Fri, 20 Sep 2019 08:52:18 +0800 Subject: [PATCH 4/4] fix bug for issue #1862 Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: https://github.com/secdev/scapy/issues/1862 --- scapy/arch/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scapy/arch/common.py b/scapy/arch/common.py index d84e9dfa74c..35276718062 100644 --- a/scapy/arch/common.py +++ b/scapy/arch/common.py @@ -43,8 +43,8 @@ def _check_tcpdump(): # On some systems, --version does not exist on tcpdump return proc.returncode == 0 \ - or output.startswith(b'Usage: tcpdump ') \ - or output.startswith(b'tcpdump: unrecognized option') + or output.startswith(b'Usage: tcpdump ') \ + or output.startswith(b'tcpdump: unrecognized option') # This won't be used on Windows