]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Mon Mar 23 12:22:50 CDT 2009 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Tue, 24 Mar 2009 15:48:19 +0000 (15:48 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 24 Mar 2009 15:48:19 +0000 (15:48 +0000)
  * nta.c: use random key when generating tags
  Ignore-this: 3e989f42549acbdbc259383b1b64e74d

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12754 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/nta/nta.c

index a7b8ddb14a3d9ab5e00173ab086eb2fefd3b90f5..015f0455453f8be4df0f355ebf145d8f4238df76 100644 (file)
@@ -1 +1 @@
-Tue Mar 24 10:46:45 CDT 2009
+Tue Mar 24 10:47:23 CDT 2009
index 51154e431852647c730589c4344de0532f65fbb0..362d9ae960be9f4795f91916fc46010fa1f6a936 100644 (file)
@@ -1175,10 +1175,9 @@ char const *nta_agent_version(nta_agent_t const *agent)
 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 @@ static int agent_tag_init(nta_agent_t *self)
   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 @@ int agent_init_contact(nta_agent_t *self)
   if (!self->sa_contact)
     return -1;
 
+  agent_tag_init(self);
+
   return 0;
 }