All structures for network packets must have __attribute__((packed))

Maksim Tamarsky mtamarsky at nsg.net.ru
Thu Oct 16 17:54:29 CEST 2014


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20141016/9de6f406/attachment.html>


More information about the Bird-users mailing list