[Asterisk-cvs] libpri pri_q921.h,1.11,1.12 pri_q931.h,1.20,1.21

kpfleming at lists.digium.com kpfleming at lists.digium.com
Wed Apr 20 10:32:52 CDT 2005


Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/tmp/cvs-serv2798

Modified Files:
	pri_q921.h pri_q931.h 
Log Message:
ensure that Q.921/Q.931 structures are always aligned on 8-bit boundaries, even on platforms with non-default structure alignment (bug #4052)


Index: pri_q921.h
===================================================================
RCS file: /usr/cvsroot/libpri/pri_q921.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- pri_q921.h	27 Oct 2004 20:17:17 -0000	1.11
+++ pri_q921.h	20 Apr 2005 15:23:35 -0000	1.12
@@ -78,7 +78,7 @@
 	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 @@
 #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 @@
 #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 {

Index: pri_q931.h
===================================================================
RCS file: /usr/cvsroot/libpri/pri_q931.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- pri_q931.h	2 Mar 2005 15:56:11 -0000	1.20
+++ pri_q931.h	20 Apr 2005 15:23:35 -0000	1.21
@@ -81,7 +81,7 @@
 #endif
 	u_int8_t contents[0];
 	u_int8_t crv[3];
-} q931_h;
+} __attribute__ ((packed)) q931_h;
 
 
 /* Message type header */
@@ -94,14 +94,14 @@
 	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)




More information about the svn-commits mailing list