On 03/28/11 14:14, Alon Levy wrote:
>>> +static void ccid_card_vscard_send_init(PassthruState *s)
>>> > > +{
>>> > > +    VSCMsgInit msg = {
>>> > > +        .version = htonl(VSCARD_VERSION),
>>> > > +        .magic = VSCARD_MAGIC,
>>> > > +        .capabilities = {0}
>>> > > +    };
>>> > > +
>> > 
>> > If this goes over the wire, don't you need to htonl(VSCARD_MAGIC) here
>> > if someone tries to run passthrough from a big endian system to a little
>> > endian system, or vice versa?
> The VSCARD_MAGIC definition is actually a cast of a string, so it is already
> in the correct byte order:
> 
> libcacard/vscard_common.h:#define VSCARD_MAGIC (*(uint32_t *)"VSCD")
> 

Ah, I was staring at it for a bit and I wasn't quite sure, which is why
I asked the question. Might be worth adding a comment about it.

Otherwise it is good then, so....

Acked-by: Jes Sorensen <jes.soren...@redhat.com>

Reply via email to