Wireshark-bugs: [Wireshark-bugs] [Bug 2672] Infiniband Dissector Plugin 1.2.0
Date: Mon, 14 Jul 2008 13:35:14 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2672





--- Comment #7 from Guy Harris <guy@xxxxxxxxxxxx>  2008-07-14 13:35:13 PDT ---
Dissectors shouldn't refer to members of the tvbuff_t structure; they should,
instead, use accessor routines such as tvb_length() and tvb_reported_length(). 
(We don't guarantee that the tvbuff_t structure will continue to have
particular members, or that they'll have particular offsets.)

It looks as if the "payload type" in a normal data packet has an Ethernet type
in the upper 2 bytes; is that just a convention, or does some Infiniband spec
dictate that (at least when the lower 2 bytes are 0)?

In parse_EtherType(), should it just call, for example, the ethertype()
routine, rather than checking for particular Ethernet types?

Most calculations should probably use tvb_reported_length() rather than
tvb_length(), so that we correctly calculate the actual lengths of packets.  If
you're building a subset tvbuff using that, you also need tvb_length(), so that
both the captured length and reported length of the tvbuff are correct.  (We
need a routine that just takes a reported length and makes a subset tvbuff,
doing the captured-length calculation itself.)


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