From 0a3a8166224e57062d1be2662a3703254dad50a4 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 20 Apr 2005 15:23:35 +0000 Subject: [PATCH] ensure that Q.921/Q.931 structures are always aligned on 8-bit boundaries, even on platforms with non-default structure alignment (bug #4052) git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@211 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- pri_q921.h | 6 +++--- pri_q931.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pri_q921.h b/pri_q921.h index 3ef5566..23bcfdc 100755 --- a/pri_q921.h +++ b/pri_q921.h @@ -78,7 +78,7 @@ typedef struct q921_header { u_int8_t tei:7; /* Terminal Endpoint Identifier (0) */ #endif u_int8_t data[0]; /* Further data */ -} q921_header; +} __attribute__ ((packed)) q921_header; /* A Supervisory Format frame */ typedef struct q921_s { @@ -98,7 +98,7 @@ typedef struct q921_s { #endif u_int8_t data[0]; /* Any further data */ u_int8_t fcs[2]; /* At least an FCS */ -} q921_s; +} __attribute__ ((packed)) q921_s; /* An Unnumbered Format frame */ typedef struct q921_u { @@ -116,7 +116,7 @@ typedef struct q921_u { #endif u_int8_t data[0]; /* Any further data */ u_int8_t fcs[2]; /* At least an FCS */ -} q921_u; +} __attribute__ ((packed)) q921_u; /* An Information frame */ typedef struct q921_i { diff --git a/pri_q931.h b/pri_q931.h index ac77ac7..ee406ba 100755 --- a/pri_q931.h +++ b/pri_q931.h @@ -81,7 +81,7 @@ typedef struct q931_h { #endif u_int8_t contents[0]; u_int8_t crv[3]; -} q931_h; +} __attribute__ ((packed)) q931_h; /* Message type header */ @@ -94,14 +94,14 @@ typedef struct q931_mh { u_int8_t f:1; #endif u_int8_t data[0]; -} q931_mh; +} __attribute__ ((packed)) q931_mh; /* Information element format */ typedef struct q931_ie { u_int8_t ie; u_int8_t len; u_int8_t data[0]; -} q931_ie; +} __attribute__ ((packed)) q931_ie; #define Q931_RES_HAVEEVENT (1 << 0) #define Q931_RES_INERRROR (1 << 1)