diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-05 17:44:44 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-05 17:44:44 +0000 |
commit | e0ba99b7f5b9f06dda7fe4baa8a7fb90e2ab40c8 (patch) | |
tree | 6334c0ffd529b865c510fbfb7a06b71e2c6d6ceb /udptl.c | |
parent | 54a140d030be645458cc82416501f0386e1d9e4b (diff) |
Bug 6873 - Finish moving from the non-threadsafe (and poor randomness) rand() to threadsafe ast_random()
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17627 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'udptl.c')
-rw-r--r-- | udptl.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -794,7 +794,7 @@ struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struc udptl->tx[i].buf_len = -1; } - udptl->seqno = rand() & 0xffff; + udptl->seqno = ast_random() & 0xffff; udptl->them.sin_family = AF_INET; udptl->us.sin_family = AF_INET; @@ -810,7 +810,7 @@ struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struc setsockopt(udptl->fd, SOL_SOCKET, SO_NO_CHECK, &nochecksums, sizeof(nochecksums)); #endif /* Find us a place */ - x = (rand()%(udptlend - udptlstart)) + udptlstart; + x = (ast_random() % (udptlend - udptlstart)) + udptlstart; startplace = x; for (;;) { udptl->us.sin_port = htons(x); |