Skip to content

Commit 078e65b

Browse files
committed
SIP PN: Prevent overlapping modifications of pn_ebr_filters template
The @pn_ebr_filters templates are actually allocated in shared memory and can be modified by multiple SIP workers concurrently, leading to occasional strange routing of INVITEs. The fix is to simply allocate the objects in private memory instead. Credits to Ondrej Jirman <[email protected]> for documenting, troubleshooting and providing an initial fix! Related to #3394
1 parent 8e93d08 commit 078e65b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/reg/pn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int pn_init(void)
131131
param->s.len, param->s.s);
132132

133133
/* build the filter templates, values are to be filled in at runtime */
134-
filter = shm_malloc(sizeof *filter);
134+
filter = pkg_malloc(sizeof *filter);
135135
if (!filter) {
136136
LM_ERR("oom\n");
137137
return -1;
@@ -161,7 +161,7 @@ int pn_init(void)
161161
return -1;
162162
}
163163

164-
provider = shm_malloc(sizeof *provider + pnp->s.len + 1 +
164+
provider = pkg_malloc(sizeof *provider + pnp->s.len + 1 +
165165
MAX_FEATURE_CAPS_SIZE);
166166
if (!provider) {
167167
LM_ERR("oom\n");

0 commit comments

Comments
 (0)