-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix bug for issue #1862, that is with new posts today. #2255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: #1862 (comment)
Can we re-trigger the CI checking? |
@MaoJianwei which OS/distribution are you using? |
Kernel 3.10,Red Hat 4.8 @guedou |
4.8 or 5.8 ? Could you share the full output of |
4.8 , I got it from the output is mentioned at #1862 by me, as follow:
And, this commit works for my server :) @guedou |
scapy/arch/common.py
Outdated
|
||
# 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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is longer than 79 characters. Please split it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed this, please review again, thanks :)
Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: #1862
Codecov Report
@@ Coverage Diff @@
## master #2255 +/- ##
==========================================
- Coverage 85.62% 84.94% -0.69%
==========================================
Files 235 235
Lines 49046 49144 +98
==========================================
- Hits 41997 41746 -251
- Misses 7049 7398 +349
|
Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: #1862
I have fixed this, please review again, thanks :) @guedou |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flake8 fails
scapy/arch/common.py
Outdated
# 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 ') \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or output.startswith(b'Usage: tcpdump ') \ | |
or output.startswith(b'Usage: tcpdump ') \ |
scapy/arch/common.py
Outdated
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or output.startswith(b'tcpdump: unrecognized option') | |
or output.startswith(b'tcpdump: unrecognized option') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I have fixed it, please review again, thanks :)
Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option Issue link: #1862
ok, I have fixed it, please review again, thanks :) @p-l- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think on my OS it's not going to work:
# cat /etc/redhat-release
CentOS release 6.10 (Final)
# tcpdump --version
tcpdump version 4.1-PRE-CVS_2017_03_21
libpcap version 1.4.0
Usage: tcpdump [-aAdDefhIJKlLnNOpqRStuUvxX] [ -B size ] [ -c count ]
[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
[ -i interface ] [ -j tstamptype ] [ -M secret ]
[ -Q|-P in|out|inout ]
[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
[ -W filecount ] [ -y datalinktype ] [ -z command ]
[ -Z user ] [ expression ]
#
Got the same problem and similar output with rafajot on CentOS, tcpdump command returns 1 and the output does not meet with current check logic:
So one more condition |
PR #2320 fixes the CentOS issues. |
Improve the method to recognize tcpdump existence, covering more output cases in which tcpdump does not support '--version' option
Issue link:
#1862 (comment)
fixes #1862 with new posts today.