Maksim Tamarsky
2014-10-16 15:54:29 UTC
All structures for network packets must have __attribute__((packed))
We already speak about this problem 2 years ago.
On my platform i have bad structure alignment in ospf and i need make
this fix.
ospf.h
..............
struct immsb
{
#ifdef CPU_BIG_ENDIAN
u8 padding:5;
u8 i:1;
u8 m:1;
u8 ms:1;
#else
u8 ms:1;
u8 m:1;
u8 i:1;
u8 padding:5;
#endif
}*__attribute__((packed))*;
union imms
{
u8 byte;
struct immsb bit;
}*__attribute__((packed))*;
.......
--
RU:
ТаЌаÑÑкОй ÐакÑОЌ ÐлекÑаМЎÑПвОÑ
ÐМжеМеÑ-пÑПгÑаЌЌОÑÑ
ÐÐÐ ÐÐœ-ÐÑ-ÐжО
г.ÐПÑква, ÐОÑпОÑÐœÐ°Ñ 39/41 ПÑ.1302
ÐПÑÑПвÑй аЎÑеÑ: 105187 РПÑÑОÑ, ÐПÑква
Ñл.ÐПлÑМаÑ, ÐŽ.35, ПÑ.NSG
Тел./ÑакÑ: +7 495 727-19-59
Web-ÑайÑ: http://www.nsg.ru
EN:
Maksim Tamarsky
Software Engineer
NSG Ltd.
35 Volnaya Street, 105187 Moscow, Russia
+7 495 727-19-59
http://www.nsg.ru
We already speak about this problem 2 years ago.
On my platform i have bad structure alignment in ospf and i need make
this fix.
ospf.h
..............
struct immsb
{
#ifdef CPU_BIG_ENDIAN
u8 padding:5;
u8 i:1;
u8 m:1;
u8 ms:1;
#else
u8 ms:1;
u8 m:1;
u8 i:1;
u8 padding:5;
#endif
}*__attribute__((packed))*;
union imms
{
u8 byte;
struct immsb bit;
}*__attribute__((packed))*;
.......
--
RU:
ТаЌаÑÑкОй ÐакÑОЌ ÐлекÑаМЎÑПвОÑ
ÐМжеМеÑ-пÑПгÑаЌЌОÑÑ
ÐÐÐ ÐÐœ-ÐÑ-ÐжО
г.ÐПÑква, ÐОÑпОÑÐœÐ°Ñ 39/41 ПÑ.1302
ÐПÑÑПвÑй аЎÑеÑ: 105187 РПÑÑОÑ, ÐПÑква
Ñл.ÐПлÑМаÑ, ÐŽ.35, ПÑ.NSG
Тел./ÑакÑ: +7 495 727-19-59
Web-ÑайÑ: http://www.nsg.ru
EN:
Maksim Tamarsky
Software Engineer
NSG Ltd.
35 Volnaya Street, 105187 Moscow, Russia
+7 495 727-19-59
http://www.nsg.ru