Wireshark mailing list archives

Re: The ieee802.11 dissector is a steaming pile of ordure


From: Bill Meier <wmeier () newsguy com>
Date: Wed, 9 Sep 2015 12:03:31 -0400

On 9/9/2015 11:23 AM, Richard Sharpe wrote:
Take a look at epan/dissectors/packet-ieee80211.c!

Specifically, add_tagged_field.

That function is approximately 2,300 lines long and it consists of one
big switch statement with every arm containing open-coded statements
to add things to the proto tree.


It's even worse:

add_fixed_field() given a "fixed field number" does a linear search thru a (large) table to to find the number (and the associated function address) and then calls the function ...

One side effect: there are functions which aren't used but since they're in the table, they're not flagged as unused by the compiler.

In several cases there is (or was) duplicate code elsewhere doing a dissection similar to the unused "fixed field functions".

(I was working to fix all this but got a bit bored because I had to spend time delving thru the 802211 spec trying to understand the code. I guess I should at least do that work (unless you have a broader solution in mind to handle both tagged and fixed fields ?)

Who does that?


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


Current thread: