Re: struct iphdr in include/linux/ip.h (probably bug in headerfile)

From: Andreas Schwab
Date: Tue Jun 21 2005 - 07:03:09 EST


k8 s <uint32@xxxxxxxxx> writes:

> Hello,
>
> The following definition in linux/include/ip.h is creating problems.
>
> How does Endianness affect BIT ORDER
> IT affetc only BYTE ORDER

Bit order and byte order are independent properties of the architecture.
That's why they are configured with different macros.

> ------------------------------------------------------------------------
> struct iphdr {
> #if defined(__LITTLE_ENDIAN_BITFIELD)
> __u8 ihl:4,
> version:4;
> #elif defined (__BIG_ENDIAN_BITFIELD)
> __u8 version:4,
> ihl:4;
> --------------------------------------------------------------------------
> Here I have a network device which works on both little endian and big
> endian machines.
> I found out that the driver of the device was saying unrecognizable
> packet when i assign

The you probably didn't define the right macro of the ones referenced
above.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/