[sr-dev] git:5.1:275ff956: tm: macro to define the ptr address for tm cell uac field

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 2 16:13:38 CEST 2018


Module: kamailio
Branch: 5.1
Commit: 275ff956e460af769cb4f659a21162317e653695
URL: https://github.com/kamailio/kamailio/commit/275ff956e460af769cb4f659a21162317e653695

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-10-02T16:05:47+02:00

tm: macro to define the ptr address for tm cell uac field

(cherry picked from commit cb984a53016762cb0932ed4dec4c75edb8997c0f)

---

Modified: src/modules/tm/h_table.c

---

Diff:  https://github.com/kamailio/kamailio/commit/275ff956e460af769cb4f659a21162317e653695.diff
Patch: https://github.com/kamailio/kamailio/commit/275ff956e460af769cb4f659a21162317e653695.patch

---

diff --git a/src/modules/tm/h_table.c b/src/modules/tm/h_table.c
index d4c86db9b5..4ca611e6ab 100644
--- a/src/modules/tm/h_table.c
+++ b/src/modules/tm/h_table.c
@@ -48,6 +48,10 @@
 #include "uac.h" /* free_local_ack */
 
 
+#define T_UAC_PTR(T) ((tm_ua_client_t*)((char*)T + sizeof(tm_cell_t) \
+								+ MD5_LEN - sizeof(((tm_cell_t*)0)->md5)))
+
+
 static enum kill_reason kr;
 
 /* pointer to the big table where all the transaction data lives */
@@ -337,9 +341,7 @@ struct cell *build_cell(struct sip_msg *p_msg)
 	new_cell->uas.response.my_T = new_cell;
 	init_rb_timers(&new_cell->uas.response);
 	/* UAC */
-	new_cell->uac =
-			(struct ua_client *)((char *)new_cell + sizeof(struct cell)
-								+ MD5_LEN - sizeof(((struct cell *)0)->md5));
+	new_cell->uac = T_UAC_PTR(new_cell);
 	/* timers */
 	init_cell_timers(new_cell);
 




More information about the sr-dev mailing list