Duplicate data in RPC packets

Amin Azez azez at ufomechanic.net
Wed Jan 16 09:11:41 GMT 2008


* Luke Howard wrote, On 15/01/08 22:41:
> Amin Azez wrote:
>> I notice RPC packets seem to duplicate the switch_is and size_is data.
>>   
> That's because the field containing the discriminant or size could
> occur after the union or array itself.
Sure, but my question was: in that case why do we need to pack the
discriminant or size field at all?
(If it always also occurs just before the union or array).

I have considered that the only requirement to do so might be if the
size is used for an array in a union member excluded by a discriminant
(if that is even permitted) but the question still remains when the
field is in the same level as the array or union.

The packer merely doesn't bother to pack if it will be packing an union
or array that uses it, and the unpacker just takes it from the first
union or array that uses it.

Sam



More information about the samba-technical mailing list