Mon Mar 23 12:22:50 CDT 2009 Pekka Pessi <first.last@nokia.com>

* 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
This commit is contained in:
Michael Jerris 2009-03-24 15:48:19 +00:00
parent db6542b516
commit 79081a2faa
2 changed files with 5 additions and 4 deletions

View File

@ -1 +1 @@
Tue Mar 24 10:46:45 CDT 2009
Tue Mar 24 10:47:23 CDT 2009

View 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;
}