ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Stop dissection in get_pdu_len

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Thu, 24 May 2012 18:02:50 +0200
Hi,

On Thu, May 24, 2012 at 11:35:34AM -0400, Tobias Weiss wrote:
> I'm using tcp_dissect_pdus() to reassemble packets in my dissector. One of
> my functions will calculate the length of the real message based on a
> header with a fixed length (get_pdu_len function pointer). But what is the
> best way to stop the dissection in get_pdu_len if I figured out that the
> header is invalid? I could just return 0 which would result in a call to
> show_reported_bounds_error(), but is that the best way to report the error?

You can't. But you can check header before calling tcp_dissect_pdus().
But it'd be good to have some tcp_dissect_pdus_heur(), feel free to write one :-)

Cheers,
 Kuba.