tcpdump mailing list archives

[PATCH] [REPOST] enforce host byte order on usb header


From: "Abeni Paolo" <paolo.abeni () telecomitalia it>
Date: Mon, 22 Jan 2007 10:21:48 +0100

hello,

The patch contained in the previous post does conatain an offset error while accessing the linux usb header struct. The 
one attached here should fix the issue. Please give it a review, since this sort of thing is a bit tricky.

I was tempted by implementing and using an OFFSETOF() macro like:

#define OFFSETOF(TYPE, MEMBER) (((size_t) &((TYPE *)0)->MEMBER) + sizeof(((TYPE *)0)->MEMBER))

It will help to avoid the error I incurred in (substituting hard-coded offset values, with compiler generated ones), 
but I feared some portabilty issue across different compiler. What do you think?

ciao,

Paolo
--------------------------------------------------------------------

CONFIDENTIALITY NOTICE

This message and its attachments are addressed solely to the persons above and may contain confidential information. If 
you have received the message in error, be informed that any use of the content hereof is prohibited. Please return it 
immediately to the sender and delete the message. Should you have any questions, please contact us by replying to 
webmaster () telecomitalia it.

        Thank you

                                        www.telecomitalia.it

--------------------------------------------------------------------
                        

Attachment: usb_header_swap_order_2.patch
Description: usb_header_swap_order_2.patch

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

Current thread: