Wireshark-dev: [Wireshark-dev] Infiniband dissector not showing payload

From: David Ameiss <netshark@xxxxxxxxxxxxx>
Date: Thu, 20 Mar 2014 10:07:43 -0500
In trying to look at some IB captures, I noticed that any payload data included was never displayed in the packet details (tree) pane. It obviously appears in the bytes pane - but nothing in the details pane. This is with both 1.10.6 and the latest git master.

I did some poking around and debugging, and it appears that the "data" dissector is always called with a NULL tree.

Now, I'm not that familiar with IB. However, I was able to get the payload data displayed by making a change in epan/dissectors/packet-infiniband.c, in dissect_infiniband_common(), changing

/* Get the parent tree from the ERF dissector. We don't want to nest under ERF */
    if (tree && tree->parent)
    {
        /* Set the normal tree outside of ERF */
        tree = tree->parent;
        /* Set a global reference for nested protocols */
        top_tree = tree;
    }

to

/* Get the parent tree from the ERF dissector. We don't want to nest under ERF */
    if (tree && tree->parent)
    {
        /* Set the normal tree outside of ERF */
        tree = tree->parent;
        /* Set a global reference for nested protocols */
        top_tree = tree;
    }
    else
    {
        top_tree = tree;
    }

Debugging showed that tree->parent was always NULL. Making this change caused the Data to be displayed at the same tree level as Frame, Extensible Record Format, and Infiniband. Not sure this is correct, since the data is actually within the Infiniband subtree.

I can provide more details, but I don't know what other impact the above change might have. I was hoping someone more familiar with the IB dissector might determine what the proper fix is.

--
David Ameiss
netshark@xxxxxxxxxxxxx