Module: kamailio
Branch: master
Commit: 55c6f7751c81c8d738409e8c9470224ab9924cb7
URL:
https://github.com/kamailio/kamailio/commit/55c6f7751c81c8d738409e8c9470224…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-04-21T12:55:17+02:00
presence: compute presentity table slot index using correct structure
---
Modified: src/modules/presence/hash.c
---
Diff:
https://github.com/kamailio/kamailio/commit/55c6f7751c81c8d738409e8c9470224…
Patch:
https://github.com/kamailio/kamailio/commit/55c6f7751c81c8d738409e8c9470224…
---
diff --git a/src/modules/presence/hash.c b/src/modules/presence/hash.c
index 6d868e165d..6767f8e007 100644
--- a/src/modules/presence/hash.c
+++ b/src/modules/presence/hash.c
@@ -1024,7 +1024,7 @@ int ps_ptable_replace(ps_presentity_t *pt)
ptc.ruid = pres_sruid.uid;
}
- idx = ptn->hashid % _ps_ptable->ssize;
+ idx = ptc.hashid % _ps_ptable->ssize;
lock_get(&_ps_ptable->slots[idx].lock);
ptn = _ps_ptable->slots[idx].plist;
@@ -1082,7 +1082,7 @@ int ps_ptable_update(ps_presentity_t *pt)
ptc.ruid = pres_sruid.uid;
}
- idx = ptn->hashid % _ps_ptable->ssize;
+ idx = ptc.hashid % _ps_ptable->ssize;
lock_get(&_ps_ptable->slots[idx].lock);
ptn = _ps_ptable->slots[idx].plist;
@@ -1138,7 +1138,7 @@ int ps_ptable_remove(ps_presentity_t *pt)
memcpy(&ptc, pt, sizeof(ps_presentity_t));
ptc.hashid = core_case_hash(&pt->user, &pt->domain, 0);
- idx = ptn->hashid % _ps_ptable->ssize;
+ idx = ptc.hashid % _ps_ptable->ssize;
lock_get(&_ps_ptable->slots[idx].lock);
ptn = _ps_ptable->slots[idx].plist;