[Ocfs2-tools-devel] [PATCH 1/1] wireshark-ocfs2: add dlm_query_join response handler

jeff.liu jeff.liu at oracle.com
Fri Aug 14 08:08:01 PDT 2009


Sunil Mushran 写道:
> jeff.liu wrote:
>>>> +static void dissect_dlm_query_join_response(proto_tree *tree,
>>>> + proto_item *item,
>>>> + tvbuff_t *tvb,
>>>> + int offset)
>>>> +{
>>>> + union dlm_query_join_response response;
>>>> + struct dlm_query_join_packet packet;
>>>> + guint32 status;
>>>> +
>>>> + status = tvb_get_ntohl(tvb, offset);
>>>> +
>>>> + /* NOP if ocfs2-1.2.x message coming */
>>>> + if (status < JOIN_PROTOCOL_MISMATCH)
>>>> + return ;
>>>
>>> Not sure I understand this. Can't you key off the size of the packet?
>> here my idea is, by comparing the status value with 
>> JOIN_PROTOCOL_MISMATCH to determine the message version, since the 
>> status value defined in old ocfs-1.2.9 should be dissected from 0 to 
>> 3, but for 1.4.2 or newer, the status value is bigger than 3 due to 
>> the structure changed and it was packed in big-endian.
>>
>> It's also easy to compute the packet size to determine the message 
>> version by figure out the buffer size start from the offset of 
>> "Magic". I'll submit the next version in this way if you think the 
>> current approach is not reasonable.
>
> We cannot rely on a specific value unless that value is hard coded
> in the packet. Like a signature or message type, etc. In this specific
> case, the assumption is that 1.4/mainline will not return JOIN_OK.
> That's incorrect. Go with the packet size logic.
I have made a wrong estimation by computing the message size to 
determine the message version before.
according to the comparison the size of o2net_msg structure defined in 
tcp.h, it is same for all ocfs2 versions.
So, in this way, the dissected package size should no different since 
this message contains the ocfs2 header only.

any hints is appreciated.


Thanks,
Jeff





More information about the Ocfs2-tools-devel mailing list