-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide more information when packet capture fails
This change is motivated by user @deliciouslytyped and the comment left here: #119 (comment). Thanks! If the user mistypes the interface name, for example, termshark's stderr is misleading because it always refers the user to a link with information on how to set up tshark for non-root capture. To make this better, I now capture the stderr for the test process that is launched to test packet capture when termshark starts. If the process returns a non-zero code, I print that stderr on termshark's stderr. For example: $ termshark -i wlanfoo (The termshark UI will start when packets are detected on wlanfoo...) Cannot capture on device wlanfoo: exit status 1 (exit code 1) Standard error stream from the capture process: Starting termshark's custom live capture procedure. First, trying dumpcap command /usr/bin/dumpcap -i wlanfoo -a duration:1 Capturing on 'wlanfoo' dumpcap: The capture session could not be initiated on interface 'wlanfoo' (No such device exists). Please check that you have the proper interface or pipe specified. Retrying with capture command [/home/gcla/bin/tshark-slow -i wlanfoo -a duration:1] Capturing on 'wlanfoo' tshark: The capture session could not be initiated on interface 'wlanfoo' (No such device exists). Please check that you have the proper interface or pipe specified. 0 packets captured You might need: sudo setcap cap_net_raw,cap_net_admin eip dumpcap Or try running with sudo or as root. See https://termshark.io/no-root for more info.
- Loading branch information
Showing
3 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters