[sr-dev] git:master:088b3a41: Merge pull request #803 from athonet-open/patch/fix-auth-vectors-order

GitHub noreply at github.com
Fri Oct 14 12:12:45 CEST 2016


Module: kamailio
Branch: master
Commit: 088b3a415e892f75f5d8f9447b0b259c1db3126e
URL: https://github.com/kamailio/kamailio/commit/088b3a415e892f75f5d8f9447b0b259c1db3126e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: GitHub <noreply at github.com>
Date: 2016-10-14T12:12:38+02:00

Merge pull request #803 from athonet-open/patch/fix-auth-vectors-order

ims_auth: Put fresh keys from HSS on top of list

---

Modified: modules/ims_auth/authorize.c

---

Diff:  https://github.com/kamailio/kamailio/commit/088b3a415e892f75f5d8f9447b0b259c1db3126e.diff
Patch: https://github.com/kamailio/kamailio/commit/088b3a415e892f75f5d8f9447b0b259c1db3126e.patch

---

diff --git a/modules/ims_auth/authorize.c b/modules/ims_auth/authorize.c
index 4facbb9..09c7137 100644
--- a/modules/ims_auth/authorize.c
+++ b/modules/ims_auth/authorize.c
@@ -1689,12 +1689,13 @@ int add_auth_vector(str private_identity, str public_identity, auth_vector * av)
         private_identity.len, private_identity.s, aud->hash);
 
 
-    av->prev = aud->tail;
-    av->next = 0;
+    av->prev = 0;
+    if (aud->head) {
+        av->next = aud->head;
+        aud->head->prev = av;
+    }
 
-    if (!aud->head) aud->head = av;
-    if (aud->tail) aud->tail->next = av;
-    aud->tail = av;
+    aud->head = av;
 
     auth_data_unlock(aud->hash);
     return 1;




More information about the sr-dev mailing list