Module: kamailio
Branch: master
Commit: 6aa967eb82fa9092f0a32101e44798e4d66fc708
URL:
https://github.com/kamailio/kamailio/commit/6aa967eb82fa9092f0a32101e44798e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-11T12:54:25+01:00
debugger: updated dbg_fixup_get_action() to use helper macro for structure address
---
Modified: src/modules/debugger/debugger_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6aa967eb82fa9092f0a32101e44798e…
Patch:
https://github.com/kamailio/kamailio/commit/6aa967eb82fa9092f0a32101e44798e…
---
diff --git a/src/modules/debugger/debugger_mod.c b/src/modules/debugger/debugger_mod.c
index 3b3b7922dd2..b6248644d65 100644
--- a/src/modules/debugger/debugger_mod.c
+++ b/src/modules/debugger/debugger_mod.c
@@ -320,12 +320,13 @@ static int w_dbg_dump(struct sip_msg *msg, char *mask, char *level)
*/
static struct action *dbg_fixup_get_action(void **param, int param_no)
{
- struct action *ac, ac2;
- action_u_t *au, au2;
+ cfg_action_t *ac;
+ action_u_t *au;
/* param points to au->u.string, get pointer to au */
- au = (void *)((char *)param - ((char *)&au2.u.string - (char *)&au2));
+ au = ksr_container_of(param, action_u_t, u.string);
au = au - 1 - param_no;
- ac = (void *)((char *)au - ((char *)&ac2.val - (char *)&ac2));
+ /* au points to ac->val, get pointer to ac */
+ ac = ksr_container_of(au, cfg_action_t, val);
return ac;
}