[sr-dev] git:master:0fd0715d: core: ensure cfg_block structure is 8 byte aligned

Spencer Thomason spencer at whiteskycommunications.com
Mon Jul 4 09:41:26 CEST 2016


Module: kamailio
Branch: master
Commit: 0fd0715d015a2396b0ec66cb0bc83ec0b61c0d08
URL: https://github.com/kamailio/kamailio/commit/0fd0715d015a2396b0ec66cb0bc83ec0b61c0d08

Author: Spencer Thomason <spencer at whiteskycommunications.com>
Committer: Spencer Thomason <spencer at whiteskycommunications.com>
Date: 2016-07-01T09:14:12-07:00

core: ensure cfg_block structure is 8 byte aligned

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

---

Modified: cfg/cfg_struct.h

---

Diff:  https://github.com/kamailio/kamailio/commit/0fd0715d015a2396b0ec66cb0bc83ec0b61c0d08.diff
Patch: https://github.com/kamailio/kamailio/commit/0fd0715d015a2396b0ec66cb0bc83ec0b61c0d08.patch

---

diff --git a/cfg/cfg_struct.h b/cfg/cfg_struct.h
index 452bb90..6436eed 100644
--- a/cfg/cfg_struct.h
+++ b/cfg/cfg_struct.h
@@ -129,6 +129,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