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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2023-12-11T12:25:56+01:00

tm: use helper macro to get structure address from member

---

Modified: src/modules/tm/timer.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/1b81cbc9f79354aae604e33ac978dece95c0326c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/1b81cbc9f79354aae604e33ac978dece95c0326c.patch

---

diff --git a/src/modules/tm/timer.c b/src/modules/tm/timer.c
index a2ebb434ccb..c0cbade59d6 100644
--- a/src/modules/tm/timer.c
+++ b/src/modules/tm/timer.c
@@ -486,8 +486,8 @@ ticks_t retr_buf_handler(ticks_t ticks, struct timer_ln 
*tl, void *p)
        unsigned long crt_retr_interval_ms;
        struct cell *t;
 
-       rbuf = (struct retr_buf *)((void *)tl
-                                                          - (void *)(&((struct 
retr_buf *)0)->timer));
+       rbuf = ksr_container_of(tl, struct retr_buf, timer);
+
        membar_depends(); /* to be on the safe side */
        t = rbuf->my_T;
 

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to