Wireshark mailing list archives

Re: How to troubleshoot extcap applications?


From: João Valverde <j () v6e pt>
Date: Wed, 1 Dec 2021 13:57:19 +0000

This is almost certainly my fault when integrating extcap with wslog. Thanks for looking into it.

I'm not sure disabling every message to stderr is a good idea. The problem space is the same as with dumpcap and that already works seamlessly.

But for now muting stderr with extcap --debug is probably good enough and I can look into it later, if you prefer.

On 01/12/21 13:18, Jirka Novak wrote:
Hi,

   I noticed issue below and I propose a solution for it. Can I ask for
comments?

   Every extcap tool has --debug and --debug-file options, but when they
are used, it do "nothing". File is created, but it is empty.
   Later I found that it must be used with --log-level=debug to really
log messages.
   The issue is that when you increase --log-level, it logs to console
(STDERR). So when extcap is started from Wireshark, it mixes log output
with packet data and wireshark gets confused and I found no way how to
make it operational.
   In other words you can't use debug of extcap from Wireshark.

   In code I found that the reason is that wsutils/wscode.c writes every
message to STDERR. If application registers additional file, it is
copied to it too, but output to STDERR is made in every case.
   Applications can replace default writer to STDERR, but no extcap do it.

   My proposal is to modify extcap/extcap-base.c:
1) When --debug is used, set log level to debug so you don't have to add
--log-level
2) If --log-file used, register custom log writer with
ws_log_init_with_writer() which will discard all messages so just write
to file will be made.
3) Update log init in every extcap

   Change is quite simple, but involves all extcaps. I already tested it
and it works. I'm just not sure every extcap.
   I'm ready to prepare patch.

                                        Best regards,

                                                Jirka
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
              mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: