On Thu, Aug 04, 2005 at 06:49:46AM -0700, David S. Miller wrote:
> From: Harald Welte <[EMAIL PROTECTED]>
> Date: Thu, 4 Aug 2005 00:03:53 +0200
> 
> > However, all nfnetlink-based protocols are supposed to be both endian
> > and 32/64 as well as alignment (*) safe.   the protocol definitions
> > always use u_intXX_t types, all network byte order, and no kernel pointers
> > passed to userspace or similar crap ;)
> 
> You cannot use "u64" objects, even though that is supposed to
> be a portable type.  i386 does not align u64's on an 8-byte
> boundary, whereas every sane platform in the world (including
> x86_64) does.
> 
> This is where the compatability problems come from.

We only have one case where 64byte types are used: timestamps.  the
structure consists of two u_int64_t members - nothing before that and
nothing behind (so no padding required).  This structure
(nfqnl_msg_packet_timestamp and nfulnl_msg_packet_timestamp) is put into
one nfattr (like rtattr).

Also, this data structure is only passed from kernel->userspace, and
kernel will always be 64bit (who has more stringend alignment rules). 

Even if we chose to send it from userspace to kernel at some point in
the future, it would be something that i386 userspace would have to take
care of, not the kernel.

Unless I'm overlooking something, to the best of my knowledge I don't
think we could still run into any trouble here.

-- 
- Harald Welte <[EMAIL PROTECTED]>                      http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Attachment: pgpFkxSoOM0qe.pgp
Description: PGP signature

Reply via email to