1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fixed bugs on IP+big endian architecture.

This commit is contained in:
Matias Fontanini
2012-10-03 00:35:16 -03:00
parent 42098e8566
commit 16a81c0589
2 changed files with 9 additions and 0 deletions

View File

@@ -118,9 +118,15 @@ namespace Tins {
* initialization
*/
option_identifier(uint8_t value)
#if TINS_IS_LITTLE_ENDIAN
: number(value & 0x1f),
op_class((value >> 5) & 0x03),
copied((value >> 7) & 0x01) {}
#elif TINS_IS_BIG_ENDIAN
: copied((value >> 7) & 0x01),
op_class((value >> 5) & 0x03),
number(value & 0x1f) {}
#endif
/**
* Constructor using user provided values for each field.