mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Fixed endianess issues in several classes. Everything is working on big endian architectures so far.
This commit is contained in:
@@ -156,11 +156,19 @@ namespace Tins {
|
||||
struct snaphdr {
|
||||
uint8_t dsap;
|
||||
uint8_t ssap;
|
||||
uint32_t id:2,
|
||||
reserved1:2,
|
||||
poll:2,
|
||||
reserved2:2,
|
||||
org_code:24;
|
||||
#if TINS_IS_LITTLE_ENDIAN
|
||||
uint32_t id:2,
|
||||
reserved1:2,
|
||||
poll:2,
|
||||
reserved2:2,
|
||||
org_code:24;
|
||||
#elif TINS_IS_BIG_ENDIAN
|
||||
uint32_t reserved1:2,
|
||||
poll:2,
|
||||
reserved2:2,
|
||||
id:2,
|
||||
org_code:24;
|
||||
#endif
|
||||
uint16_t eth_type;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user