[sr-dev] git:master:cb984a53: tm: macro to define the ptr address for tm cell uac field

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 2 12:21:58 CEST 2018


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-10-02T12:21:40+02:00

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

---

Modified: src/modules/tm/h_table.c

---

Diff:  https://github.com/kamailio/kamailio/commit/cb984a53016762cb0932ed4dec4c75edb8997c0f.diff
Patch: https://github.com/kamailio/kamailio/commit/cb984a53016762cb0932ed4dec4c75edb8997c0f.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