Skip to content

Commit

Permalink
tracer: use own flag for B2B tracing
Browse files Browse the repository at this point in the history
This fix prevents crashes generated when the B2B module is loaded, but
tracing is done at the transaction layer - since the transaction layer
was setting the same flag, B2B tracing was also engaged, but without the
necessary structures, leading to crashes.
  • Loading branch information
razvancrainea committed Jun 13, 2024
1 parent 0091ab4 commit efc2552
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/tracer/tracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ static int mod_init(void)
if(load_b2b_logic_api(&b2bl)< 0) {
LM_DBG("Failed to load b2b_logic API (module not loaded)\n");
} else {
b2bl.register_set_tracer_cb( b2b_set_tracer_cb, FL_USE_SIPTRACE);
b2bl.register_set_tracer_cb( b2b_set_tracer_cb, FL_USE_SIPTRACE_B2B);
}

if (load_dlg_api(&dlgb) != 0)
Expand Down Expand Up @@ -1494,7 +1494,7 @@ static int trace_b2b(struct sip_msg *msg, trace_info_p info)
* B2B logic, via the "creating new session" callback, will
* install the tracing callback into the B2B logic
*/
msg->msg_flags |= FL_USE_SIPTRACE;
msg->msg_flags |= FL_USE_SIPTRACE_B2B;

return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions parser/msg_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ enum request_method {
* one, not received */
#define FL_HAS_ROUTE_LUMP (1<<22) /* the message had Route headers added
* as lumps */
#define FL_USE_SIPTRACE_B2B (1<<23) /* used by tracer to check if the b2b
* tracing was enabled */

/* define the # of unknown URI parameters to parse */
#define URI_MAX_U_PARAMS 10
Expand Down

0 comments on commit efc2552

Please sign in to comment.