[sr-dev] git:5.5:fbb5e7a7: tm: backup and restore X/AVP values from initial transaction in DNS failover processing
Henning Westerholt
hw at gilawa.com
Tue Nov 29 11:31:39 CET 2022
Module: kamailio
Branch: 5.5
Commit: fbb5e7a736ce0798a7393ada6e0f109a490d027a
URL: https://github.com/kamailio/kamailio/commit/fbb5e7a736ce0798a7393ada6e0f109a490d027a
Author: Henning Westerholt <hw at gilawa.com>
Committer: Henning Westerholt <hw at gilawa.com>
Date: 2022-11-29T10:31:23Z
tm: backup and restore X/AVP values from initial transaction in DNS failover processing
- restore X/AVP values from initial transaction in DNS failover processing
- the X/AVP context gets lost, so we need to re-create it from the transaction
- otherwise modules that depends on the X/AVPs, e.g. topology hiding will not work
- tested with one load-balancer and two proxy servers
- previous fix d6b1c20d3ad94 was reverted, we now properly backup and restore
(cherry picked from commit 399b34c6bd4e5cbfcf4dcb699755c393229fcb99)
(cherry picked from commit 2b5b3a7fb5a26dc467a60e5e70c8b3515f57bc85)
---
Modified: src/modules/tm/timer.c
---
Diff: https://github.com/kamailio/kamailio/commit/fbb5e7a736ce0798a7393ada6e0f109a490d027a.diff
Patch: https://github.com/kamailio/kamailio/commit/fbb5e7a736ce0798a7393ada6e0f109a490d027a.patch
---
diff --git a/src/modules/tm/timer.c b/src/modules/tm/timer.c
index 26734df2ee8..3db6993b29e 100644
--- a/src/modules/tm/timer.c
+++ b/src/modules/tm/timer.c
@@ -360,6 +360,7 @@ inline static void final_response_handler(
int branch_ret;
int prev_branch;
ticks_t now;
+ tm_xlinks_t backup_xd;
#endif
#ifdef EXTRA_DEBUG
@@ -450,11 +451,15 @@ inline static void final_response_handler(
branch_ret = add_uac_dns_fallback(
t, t->uas.request, &t->uac[r_buf->branch], 0);
prev_branch = -1;
+ /* restore X/AVP values from initial transaction */
+ tm_xdata_swap(t, &backup_xd, 0);
while((branch_ret >= 0) && (branch_ret != prev_branch)) {
prev_branch = branch_ret;
branch_ret =
t_send_branch(t, branch_ret, t->uas.request, 0, 0);
}
+ /* restore X/AVP values from backup data */
+ tm_xdata_swap(t, &backup_xd, 1);
}
}
#endif
More information about the sr-dev
mailing list