Skip to content

Conversation

weshouman
Copy link

@weshouman weshouman commented Apr 5, 2024

Fix #692

@@ -344,6 +357,17 @@ async def _get_tshark_process(self, packet_count=None, stdin=None):
parameters = [self._get_tshark_path(), "-l", "-n", "-T", output_type] + \
self.get_parameters(packet_count=packet_count) + output_parameters

if not tshark_supports_protocol(self._display_filter):
suggestions = "or".join(self._suggest_protocol_name(self._display_filter))
if (suggestions == ""):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not suggestions:?

suggestions = "or".join(self._suggest_protocol_name(self._display_filter))
if (suggestions == ""):
raise TSharkProtocolNotSupportedException(
f"Protocol {self._display_filter} is not supported by TShark. " + \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the + \ here, it'll be concatenated anyway

@@ -344,6 +357,17 @@ async def _get_tshark_process(self, packet_count=None, stdin=None):
parameters = [self._get_tshark_path(), "-l", "-n", "-T", output_type] + \
self.get_parameters(packet_count=packet_count) + output_parameters

if not tshark_supports_protocol(self._display_filter):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH this seems like overkill to check it every time we get the process, since it'll only fail very rarely. Maybe we can check it on a crash to explain it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inform the user of unsupported protocol usage
2 participants