[sr-dev] git:4.2:192965d8: core: ensure cfg_block structure is 8 byte aligned

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 5 12:10:40 CEST 2016


Module: kamailio
Branch: 4.2
Commit: 192965d8636f313f81707a353c95b8b02f4905a0
URL: https://github.com/kamailio/kamailio/commit/192965d8636f313f81707a353c95b8b02f4905a0

Author: Spencer Thomason <spencer at whiteskycommunications.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-07-05T12:08:30+02:00

core: ensure cfg_block structure is 8 byte aligned

- prevents bus error on stricter cpu architectures like sparc
- reported by GH #655

(cherry picked from commit 0fd0715d015a2396b0ec66cb0bc83ec0b61c0d08)
(cherry picked from commit 795556061412439618c640ef19e8579486f0c58a)
(cherry picked from commit e9bbb8f6d945221a388c5a8bbe5e37ffb873395b)

---

Modified: cfg/cfg_struct.h

---

Diff:  https://github.com/kamailio/kamailio/commit/192965d8636f313f81707a353c95b8b02f4905a0.diff
Patch: https://github.com/kamailio/kamailio/commit/192965d8636f313f81707a353c95b8b02f4905a0.patch

---

diff --git a/cfg/cfg_struct.h b/cfg/cfg_struct.h
index 4b6d3c4..7ed9a60 100644
--- a/cfg/cfg_struct.h
+++ b/cfg/cfg_struct.h
@@ -136,6 +136,7 @@ typedef struct _cfg_block {
 	atomic_t	refcnt;		/*!< reference counter,
 					the block is automatically deleted
 					when it reaches 0 */
+	int		_pad;		/*!< force 8 byte alignment */
 	unsigned char	vars[1];	/*!< blob that contains the values */
 } cfg_block_t;
 




More information about the sr-dev mailing list