Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 4455] AppleMIDI - dissector for lightweight session protoc

Date: Sun, 7 Feb 2010 16:56:23 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4455

--- Comment #4 from Bill Meier <wmeier@xxxxxxxxxxx> 2010-02-07 16:56:18 PST ---
I've taken the liberty of reworking the code related to the callbacks to 
dissect_applemidi_heur()  and dissect_applemiddi() and the use of conversations
so that dissect_applemidi_heur is not called for a particular set UDP endpoints
after a conversation has been registered for that set of endpoints.  :)

See SVN #31824

AFAIK, I've not affected the actual dissection of applemidi packets.

What I noticed:

   applemidi_handle = find_dissector( "applemidi" );

always stored a NULL and thus 

   conversation_set_dissector( p_conv, applemidi_handle );

always used NULL as the handle.

The main result was that, although the code worked, dissect_applemidi_heur
would unnecessarily be called for each UDP packet even after a conversation
which matched that packet had been created.

Please review my changes to verify that I haven't messed anything up.


-------

Also: 

I removed the following from proto_register_applemidi()

   heur_dissector_add( "udp", dissect_applemidi_heur, proto_applemidi );

since it just adds the dissector on port 0.

(As Guy Harris has indicated elsewhere), if the intent is to make the applemidi
dissector available for "Analyze ! Decode As" then the correct way to do this
is to use dissector_add_handle().

If that was the intent, I can commit a revision with that change.

One reason I can think of to make the applemidi dissector available 
for "Analyze ! Decode As" is to be able to override some other dissector
grabbing and dissecting the packet.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.