summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/mobile
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-11-17 18:02:17 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-11-17 18:49:11 +0700
commit62164b9eabc07eac0f74d12f2faa01dd6d1d851b (patch)
tree3af369db13795c05ed9810d7d93e8ce9842d00d7 /src/host/layer23/include/osmocom/bb/mobile
parentafd5b8247fcd1d9c9ebded62e4833cc2ca04463d (diff)
mobile/gsm48_mm.h: mark some structures as 'packed'
In several code paths we put / push structures from 'gsm48_mm.h' into the message buffers, so then they're unpacked by the message receivers. The AddressSanitizer complains about unaligned pointer access and potentially unexpected behaviour. Let's fix this by explicitly marking those structures as 'packed'. Change-Id: I6af7475c609b3293af708540d569fe1616fab43f
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/mobile')
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
index 93e7c4c4..09d18ed9 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
@@ -61,7 +61,7 @@ struct gsm48_mmxx_hdr {
uint8_t sapi; /* sapi */
uint8_t emergency; /* emergency type of call */
uint8_t cause; /* cause used for release */
-};
+} __attribute__((packed));
/* GSM 6.1.2 */
#define GSM48_MMR_REG_REQ 0x01
@@ -74,7 +74,7 @@ struct gsm48_mmr {
int msg_type;
uint8_t cause;
-};
+} __attribute__((packed));
/* GSM 04.07 9.2.1 */
#define GSM48_MMXX_ST_IDLE 0
@@ -140,7 +140,7 @@ struct gsm48_mm_event {
uint32_t msg_type;
uint8_t sres[4];
-};
+} __attribute__((packed));
/* GSM 04.08 MM timers */
#define GSM_T3210_MS 20, 0