Wireshark-bugs: [Wireshark-bugs] [Bug 12368] New: Returning 0 for "this isn't my packet" doesn't

Date: Mon, 25 Apr 2016 18:29:22 +0000
Bug ID 12368
Summary Returning 0 for "this isn't my packet" doesn't work for zero-length packets
Product Wireshark
Version Git
Hardware All
OS All
Status UNCONFIRMED
Severity Normal
Priority Low
Component Dissection engine (libwireshark)
Assignee [email protected]
Reporter [email protected]

Build Information:
N/A
--
As indicated in bug 12366, there can be zero-length packets for some protocols.

Dissectors currently return the number of bytes they've dissected, with a
return value of 0 meaning "this isn't a packet for my protocol".

That doesn't distinguish between "this is my packet, but it'z zero-length" and
"this isn't my packet".

We need a better way to indicate "this isn't my packet", distinct from
indicating how many packet bytes were dissected.

There are callers that need to know how many packet bytes were dissected, so
simply changing dissectors to return an "accepted vs. rejected" Boolean and not
providing an indication of how many packet bytes were dissected won't work.

We could return a structure with both bits of information, but that's a bit
more of a pain to write (C90 doesn't support returning anonymous structure
values), and the return operation is more generated code (most if not all C
calling sequences don't support returning a short structure in two registers).


You are receiving this mail because:
  • You are watching all bug changes.