[Freeswitch-trunk] [commit] r12754 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta

FreeSWITCH SVN mikej at freeswitch.org
Tue Mar 24 08:48:19 PDT 2009


Author: mikej
Date: Tue Mar 24 10:48:19 2009
New Revision: 12754

Log:
Mon Mar 23 12:22:50 CDT 2009  Pekka Pessi <first.last at nokia.com>
  * nta.c: use random key when generating tags
  Ignore-this: 3e989f42549acbdbc259383b1b64e74d


Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Tue Mar 24 10:48:19 2009
@@ -1 +1 @@
-Tue Mar 24 10:46:45 CDT 2009
+Tue Mar 24 10:47:23 CDT 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	Tue Mar 24 10:48:19 2009
@@ -1175,10 +1175,9 @@
 static int agent_tag_init(nta_agent_t *self)
 {
   sip_contact_t *m = self->sa_contact;
-  uint32_t hash = 1;
+  uint32_t hash = su_random();
 
   if (m) {
-
     if (m->m_url->url_user)
       hash = 914715421U * hash + msg_hash_string(m->m_url->url_user);
     if (m->m_url->url_host)
@@ -1192,7 +1191,7 @@
   if (hash == 0)
     hash = 914715421U;
 
-  self->sa_branch = NTA_BRANCH_PRIME * su_ntp_now();
+  self->sa_branch = NTA_BRANCH_PRIME * (uint64_t)su_nanotime(NULL);
   self->sa_branch *= hash;
 
   self->sa_tags = NTA_TAG_PRIME * self->sa_branch;
@@ -2505,6 +2504,8 @@
   if (!self->sa_contact)
     return -1;
 
+  agent_tag_init(self);
+
   return 0;
 }
 



More information about the Freeswitch-trunk mailing list